问题
I am really struggling to understand the meaning of the error below. I develop on OS X Lion, and I have RMagick installed there, and my code works flawlessly.
Yet on the production RedHat machine, the below:
MissingSourceFile (no such file to load -- RMagick2.so):
rmagick (2.13.1) [v] lib/RMagick.rb:11
Yes, I installed the rmagick gem locally to both machines. And I have unpacked the gem on each machine to vendor/gems.
What is probably the funniest to me is that this error is so stupid. There's not an RMagick.so file on my Mac either, but the code works.
What is the problem here?
回答1:
So I removed this gem from vendor/gems, because unpacking it evidently misses the dynamic library.
Then I created a new file:
/etc/ld.so.conf.d/local.conf
and put this in there:
/usr/lib
/usr/local/lib
And now it is working.
回答2:
Just had the same problem after upgrading OS X Lion to Mountain Lion. rmagick gem was installed fine, as was imagemagick. I had to uninstall both, then reinstall to fix it.
gem uninstall rmagick
brew uninstall imagemagick
brew install imagemagick
bundle install
Of course, prior to that I had to install XCode command line tools to get git and gcc back so I could brew and make again.
回答3:
I also have the problem like your, you can visit http://www.imagemagick.org/script/binary-releases.php and use this way to install to your OS X Lion, it is work for me now.
回答4:
Sometimes this error is related to updating Imagemagick to a version which is incompatible with rmagick. Try reverting to a previous version of Imagemagick
brew switch imagemagick 6.7.7-6
Note: this command will only work if you're using brew
回答5:
I had this problem after upgrading Ubuntu from 12.10 to 13.04. It helped to reinstall the gem:
$ gem uninstall rmagick
$ bundle # or gem install rmagick, if you don't use bundler
来源:https://stackoverflow.com/questions/7169178/no-such-file-to-load-rmagick2-so