no such file to load — rack

喜夏-厌秋 提交于 2019-12-06 03:21:02

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/8830000/no-such-file-to-load-rack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!