没有要加载的文件--rack
有时,即使安装了机架,我的 Rails 应用程序也会出现错误(没有要加载的文件 - 机架)。
[宝石文件] gem 'rack', '1.2.1'
如果我刷新页面,它会加载正常。 所以这不是宝石的问题。 什么可能导致错误?
谢谢。
山姆
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为如果你在本地启动你的网站,这种情况就不会发生。那你用的是什么服务呢?我在 DreamHost 上遇到过此类错误。
对于 DreamHost,问题是他们使用不同版本(较旧)的 Rack,与最新版本的 Rails 不兼容。尝试在 Gemfile 中指定 Rack 版本(在大多数情况下,您还必须降级 Rails)。这可能有帮助。
另一个可能的原因是你在本地机器上使用RVM,但是对于服务器,例如Passenger + Nginx/Apache,RVM可能无法正常工作(实际上,我使用Passenger + RVM总是出错)。指定您的 Gem 目录可能会有所帮助。
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.