没有这样的文件可以加载 -- 架[英] no such file to load -- rack

本文是小编为大家收集整理的关于没有这样的文件可以加载 -- 架的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

有时,我的轨道应用程序也会出现错误(即使安装了机架,也没有加载 - 机架).

[gemfile] 宝石'架','1.2.1'

如果我刷新页面,则可以加载良好. 所以这不是宝石问题. 什么可能导致错误?

谢谢.

sam

推荐答案

我认为,如果您本地启动您的网站,这将不会发生.那么您使用了什么服务?我在Dreamhost上遇到了这种错误.

对于Dreamhost,问题是他们使用不同版本(较旧)的机架,这与最新版本的Rails不兼容.尝试在Gemfile中指定机架版本(在大多数情况下,您也必须降级导轨).它可能会有所帮助.

另一个可能的原因是您在本地计算机上使用RVM,但是对于服务器,乘客 + nginx/apache,rvm可能无法正常工作(实际上,我总是使用乘客 + RVM遇到错误).指定宝石目录可能会有所帮助.

本文地址:https://www.itbaoku.cn/post/786626.html

问题描述

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

推荐答案

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.