Spoons
Spoons

Reputation: 75

Deploying Rails App with Passenger

I tried to deploy my rails application with passenger and apache and I get the following error message.

/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]) ^

The code of the static_pages_controller.rb is the following

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

Upvotes: 0

Views: 181

Answers (2)

Yuriy Goldshtrakh
Yuriy Goldshtrakh

Reputation: 2014

Do you have the same ruby version on both production and development?

Try changing

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

to

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

Upvotes: 2

Veraticus
Veraticus

Reputation: 16074

Try typing ruby -v on the command line. I bet you're using 1.8, which doesn't allow the hash syntax you're trying to use here. Try this instead:

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

Upvotes: 3

Related Questions