无法在 Rails 中加载 RMagic,但可以在 IRB 中加载
我无法让 RMagick 正常工作。当我在 IRB 中运行 require 时:
irb(main):001:0> require 'RMagick'
=> true
但是当我尝试将其包含在我的 Rails 应用程序中时,我得到:
no such file to load -- RMagick
我通过 Gem 安装了 RMagick。
gem list
*** LOCAL GEMS ***
bundler (1.0.18)
daemon_controller (0.2.6)
fastthread (1.0.7)
minitest (1.6.0)
passenger (3.0.8)
rack (1.3.2)
rake (0.8.7)
rdoc (2.5.8)
rmagick (2.13.1)
Ruby 版本:
ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
Passenger for Rails 正在加载:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.8
乘客模块和控制台之间的 ruby 版本差异会成为问题吗?
非常感谢! 〜詹姆斯
I'm having trouble getting RMagick to work properly. When I run the require in IRB:
irb(main):001:0> require 'RMagick'
=> true
But when I try to include it in my Rails app I get:
no such file to load -- RMagick
I installed RMagick through the Gem.
gem list
*** LOCAL GEMS ***
bundler (1.0.18)
daemon_controller (0.2.6)
fastthread (1.0.7)
minitest (1.6.0)
passenger (3.0.8)
rack (1.3.2)
rake (0.8.7)
rdoc (2.5.8)
rmagick (2.13.1)
Ruby version:
ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
Passenger for Rails is loading:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.8
Could the difference in ruby versions between the passenger module and the console be a problem?
Thanks so much!
~James
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然,Ruby 版本必须相同。我强烈建议您改为使用 RVM:http://beginrescueend.com/ 因为它将是从长远来看,很多无痛。
Definitely- the ruby versions need to be the same. I would urge you to move over to using RVM instead: http://beginrescueend.com/ as it'll be a lot painless in the long run.
我过去设置了 RMagick,并基于对旧代码的快速浏览,我必须这样做:
我还记得这样做在一个特定的系统上有效:
I setup RMagick in the past and based on a quick glance at old code, I had to do this:
I also remember that doing this worked on one particular system: