机架错误安装问题。服务器未启动
我刚刚安装了 Rack-Bug 并在 config 文件夹中创建了它所需的中间件文件。但我无法启动我的服务器。 我使用 Rails 2.3.4 和 Ruby 1.8.7。
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant IPAddr (NameError)
来自 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependency.rb:80:in const_missing' 来自 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependency.rb:92:in
const_missing' 来自 /home/xxxxx/xxxx/trunk/config/initializers/middleware.rb:6
我不知道我做错了什么。任何帮助都会很棒。
I just installed the Rack-Bug and created the middleware file that it needs in the config folder. But I am unable to start my server.
Im using Rails 2.3.4 with Ruby 1.8.7.
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant IPAddr (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in const_missing'
const_missing'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:92:in
from /home/xxxxx/xxxx/trunk/config/initializers/middleware.rb:6
I can't figure out what I am doing wrong. Any help would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有同样的问题。
解决方案是将以下行放在environment.rb的顶部(ruby核心类的要求:http://ruby-doc.org/core/classes/IPAddr.html):
需要 'ipaddr'
I had the same problem.
The solution is to put the following line at the top of your environment.rb (requirement of a ruby core class: http://ruby-doc.org/core/classes/IPAddr.html):
require 'ipaddr'