2013-03-16 39 views
0

目前我嘗試應用上傳我的導軌的Heroku,但我有我的CLI這個問題:Heroku的軌道deployement發出

2013-03-16T14:21:28+00:00 app[web.1]: Processing by PostsController#index as HTML 
2013-03-16T14:21:28+00:00 app[web.1]: Completed 500 Internal Server Error in 1ms 
2013-03-16T14:21:28+00:00 app[web.1]: 
2013-03-16T14:21:28+00:00 app[web.1]: NoMethodError (undefined method `accept' for nil:NilClass): 
2013-03-16T14:21:28+00:00 app[web.1]: app/controllers/posts_controller.rb:5:in `index' 
2013-03-16T14:21:28+00:00 app[web.1]: 
2013-03-16T14:21:28+00:00 app[web.1]: 

我不是很確定什麼是怎麼回事,這是我的代碼對於routes.rbPostsController

的routes.rb

Apps2::Application.routes.draw do 

    devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks" } 

    resources :posts 

    root :to => 'posts#index' 
end 

PostController中

class PostsController < ApplicationController 
    # GET /posts 
    # GET /posts.json 
    def index 
    @posts = Post.all 

    respond_to do |format| 
     format.html # index.html.erb 
     format.json { render json: @posts } 
    end 
    end 

    # GET /posts/1 
    # GET /posts/1.json 
    def show 
    @post = Post.find(params[:id]) 

    respond_to do |format| 
     format.html # show.html.erb 
     format.json { render json: @post } 
    end 
    end 

    # GET /posts/new 
    # GET /posts/new.json 
    def new 
    @post = Post.new 

    respond_to do |format| 
     format.html # new.html.erb 
     format.json { render json: @post } 
    end 
    end 

    # GET /posts/1/edit 
    def edit 
    @post = Post.find(params[:id]) 
    end 

    # POST /posts 
    # POST /posts.json 
    def create 
    @post = Post.new(params[:post]) 

    respond_to do |format| 
     if @post.save 
     format.html { redirect_to @post, notice: 'Post was successfully created.' } 
     format.json { render json: @post, status: :created, location: @post } 
     else 
     format.html { render action: "new" } 
     format.json { render json: @post.errors, status: :unprocessable_entity } 
     end 
    end 
    end 

    # PUT /posts/1 
    # PUT /posts/1.json 
    def update 
    @post = Post.find(params[:id]) 

    respond_to do |format| 
     if @post.update_attributes(params[:post]) 
     format.html { redirect_to @post, notice: 'Post was successfully updated.' } 
     format.json { head :no_content } 
     else 
     format.html { render action: "edit" } 
     format.json { render json: @post.errors, status: :unprocessable_entity } 
     end 
    end 
    end 

    # DELETE /posts/1 
    # DELETE /posts/1.json 
    def destroy 
    @post = Post.find(params[:id]) 
    @post.destroy 

    respond_to do |format| 
     format.html { redirect_to posts_url } 
     format.json { head :no_content } 
    end 
    end 
end 

謝謝。

+1

你運行:Heroku的運行耙:DB遷移? – rbinsztock 2013-03-16 14:57:12

回答