Cannot Load RMagic in Rails, but can in IRB
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/开发者_StackOverflow中文版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
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.
I setup RMagick in the past and based on a quick glance at old code, I had to do this:
require 'RMagick'
include Magick # not sure why, but we always have to do this w/ RMagick.
I also remember that doing this worked on one particular system:
require 'rmagick' # lowercase version of require 'RMagick'
精彩评论