路缘石无法与铁轨配合使用
我有一个简单的类,它使用路边检索数据。一切正常,只需从命令行查找,但是当我将其加载到我的 Rails 应用程序中时,WebBrick 在“require 'curb'”语句上崩溃。
我对 ruby 非常陌生,所以我不确定如何准确地调试 webbrick 中的错误以确定问题所在。
如果有人知道如何解决这个问题,那就太好了,如果有人也能指出正确的方向,让我自己开始解决问题,那也会有所帮助。
I have a simple class that is using curb to retrieve data. Everything works just find from the command line, but when I load it into my rails application WebBrick crashes on the "require 'curb'" statement.
I'm extremely new to ruby so I'm not sure how exactly to debug the error from webbrick to determine what is wrong.
If someone knows how to solve this issue that would be great, if someone could also point me into the right direction to start troubleshooting the issue myself that would also help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来 Rails 找不到 gem。如果它可以从命令行运行,则 gem 应该已正确安装并且可以正常工作,所以这不是您的问题。
检查您的
environment.rb
文件。如果您没有看到curb
的依赖项,请添加它:config.gem 'curb'
然后从终端检查依赖项:
rake gems
您应该会看到
curb
列为“已安装”。如果没有,请尝试重新安装:rake gems:install
Sounds like Rails can't find the gem. If it works from the command line, the gem should be installed correctly and working, so that's not your problem.
Check your
environment.rb
file. If you don't see a dependency forcurb
, add it:config.gem 'curb'
Then check dependencies from the terminal:
rake gems
You should see
curb
listed as 'Installed'. If not, try reinstalling:rake gems:install