2012-05-03 151 views
0

我試着用passenger和apache部署我的rails應用程序,我收到以下錯誤消息。乘客部署Rails應用程序

/root/finalProject/app/controllers/static_pages_controller.rb:6: syntax error, unexpected ':', expecting ')' @feed_items = current_user.feed.paginate(page: params[:page])^/root/finalProject/app/controllers/static_pages_controller.rb:6: syntax error, unexpected ')', expecting kEND @feed_items = current_user.feed.paginate(page: params[:page])^

的static_pages_controller.rb的代碼是下面

class StaticPagesController < ApplicationController 

    def home 
    if signed_in? 
     @micropost = current_user.microposts.build 
     @feed_items = current_user.feed.paginate(page: params[:page]) 
    end 
    end 

end 

回答

2

你是否在生產和開發上有相同的ruby版本?

嘗試改變

@feed_items = current_user.feed.paginate(page: params[:page]) 

@feed_items = current_user.feed.paginate(:page=>params[:page]) 
3

嘗試該命令行鍵入ruby -v。我敢打賭你使用的是1.8,它不允許你在這裏使用的哈希語法。試試這個:

@feed_items = current_user.feed.paginate(:page => params[:page])