Question

I recently upgraded a server from Ubuntu 8.04 to 10.04, and it seems to have broken RMagick, with this error:

libWand.so.10: cannot open shared object file: No such file or directory - /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick2.so

Poking around the web for ideas, I decided to try symlinking this to libMagickCore.so.2.0.1, and libWand.so.10 to libMagickWand.so.2.0.1. That got me a new error:

This installation of RMagick was configured with ImageMagick 6.3.7 but ImageMagick 6.5.7-8 is in use.

Since then I've been trying all sorts of googling and uninstalling and reinstalling of RMagick and the various ImageMagick libraries and having no luck. I think some libraries may have built from source or otherwise "manually" installed by previous staff.

---(added later:)

It appears that RMagick 2.13.0 or 2.13.1 has been fixed to work with ImageMagick 6.5.7, but when I try to specify one of those versions to gem install, it either: (a) appears to install, but only 2.12.2 shows up in 'gem list' and only 2.12.2 is loaded by my rails app; (b) errors "ERROR: Could not find a valid gem 'rmagick' (= 2.13.0) in any repository" if I specify 2.13.0. "gem -v" says 1.3.5.

---(and later:)

Updating RUbyGems to 1.3.7 as described here: http://wiki.joyent.com/all-accelerators:kb:rubygems hasn't changed anything.

Was it helpful?

Solution 3

It seems that, EVEN THOUGH /opt/ruby-enterprise/bin is in my $PATH, and EVEN THOUGH 'which gem' reports '/opt/ruby-enterprise/bin/gem', somehow when I tried to 'sudo gem install rmagick' it was installing it under /usr/lib/ruby/gems/1.8/gems instead of /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems where it belongs, and SOMEHOW, explicitly entering 'sudo /opt/ruby-enterprise/bin/gem install rmagick -v=2.13.1' got RMagick 2.13.1, which is compatible with the 'apt-get install imagemagick' version of ImageMagick (6.6.5, the one in /usr/local/bin) successfully being loaded up by my app. It's because of this: Using Ruby Enterprise Edition, gems are not installed where I would expect

Anyway my issue is now resolved but for how to correctly uninstall the ImageMagick 6.5.7 that was manually installed a couple years ago back in the days when that was what you had to do to install RMagick. I'm pretty sure I don't have the source anywhere handy with which to 'make uninstall'. Anyone know if I can safely just delete the files?

OTHER TIPS

I ran across the very same issue. Installing libmagickwand did the trick for me...

sudo apt-get install libmagickwand-dev

Just use ruby 1.9.1 instead of ruby 1.8. I used this blog post: http://blog.moonflare.com/2011/10/25/installing-ruby-1-9-2-and-gems-on-ubuntu-11-10/

The most important part is

sudo apt-get install ruby1.9.1
sudo update-alternatives --config ruby
(select the option reading “/usr/bin/ruby1.9.1″)
sudo update-alternatives --config gem
(select the option reading “/usr/bin/gem1.9.1″)

I solved with it

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top