Sometimes, my rails application gives an error (no such file to load — rack) even if rack is installed.
[Gemfile]
gem ‘rack’, ‘1.2.1’
If I refresh the page, it loads fine.
So it’s not the gem problem.
What could cause the error?
Thanks.
Sam
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think if you start your website locally, this will not happen. So what service did you use? I’ve encountered this kind of bugs on DreamHost.
For DreamHost, the problem is they use different version (older) of Rack, which is not compatible with newest version of Rails. Try to specify the Rack version in your Gemfile (and in most cases, you have to downgrade Rails as well). It may help.
Another possible reason is that you use RVM on your local machine, but for servers, for example, Passenger + Nginx/Apache, RVM may not work well (actually, I’m always getting errors using Passenger + RVM). Specifying your Gem directory may help.