0

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

2 Answers 2

3

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])
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.