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

查看:119
本文介绍了没有这样的文件加载 - 机架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,即使安装了机架,我的Rails应用程序也会出现错误(无需载入此类文件)。

[Gemfile]
gem 'rack','1.2.1'



如果我刷新页面,它会正常加载。
所以这不是宝石问题。
可能导致错误的原因是什么?



谢谢。

Sam

$ b $我认为如果你在本地启动你的网站,这是不会发生的。那么你使用了什么服务?我在DreamHost上遇到过这种错误。

对于DreamHost,问题是他们使用Rack的不同版本(旧版本),这与最新版本的Rails不兼容。尝试在Gemfile中指定Rack版本(并且在大多数情况下,您也必须降级Rails)。这可能会有所帮助。另一个可能的原因是您在本地机器上使用RVM,但对于服务器,例如Passenger + Nginx / Apache,RVM可能无法正常工作(实际上,我总是使用Passenger + RVM获取错误)。指定您的Gem目录可能会有所帮助。


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.

这篇关于没有这样的文件加载 - 机架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆