Apr 23, 2009

Jaunty and RMagick

If you're doing Ruby development under the Jaunty and you're using RMagick, make sure that after you upgrade to reinstall the libmagickwand-dev package, and then reinstall the RMagick gem:
sudo apt-get install libmagickwand-dev
sudo gem uninstall rmagick
sudo gem install rmagick --no-ri --no-rdoc
I can imagine there may be issues with other languages too, it seems like Jaunty replaces/upgrades some ImageMagick libraries, so you'll have to patch it up after you upgrade.

UPDATE(Apr. 27, 2010): The latest version of RMagick does not work with the most recent version of Imagemagick in the Ubuntu repository. To install the version of RMagick that does work, you need to use version 2.11:
sudo gem install rmagick --no-ri --no-rdoc --version=2.11


Mario Zigliotto said...

thank you!!

this post saved me some headache! thanks again

Pierre said...

Woot! Thanks!

gil said...

Hmm, still having headaches over here. After doing the above, i get:

sudo irb -rubygems -r RMagick
/usr/local/lib/site_ruby/1.8/i486-linux/RMagick.so: libMagick.so.9: cannot open shared object file: No such file or directory - /usr/local/lib/site_ruby/1.8/i486-linux/RMagick.so (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/site_ruby/1.8/RMagick.rb:11
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/lib/ruby/1.8/irb/init.rb:250:in `each'

Rob Britton said...

gil: did the "sudo gem install rmagick" part give you any errors? If there were build errors then the gem would not have been installed properly.

Also are you using the rubygems package from the Ubuntu repositories? Last I checked it is old and doesn't work right, you're better off uninstalling it and installing it from the Ruby website.

gil said...

We solved this by installing rmagick from source; that did the trick. The install of the gem didn't give us an error, but yes, we were using rubygems from ubuntu repositories.

Note that on another ubuntu upgrade (all the way from 7.10 to 9.04) the posted steps worked perfectly.

Rob Britton said...

gil: Ahh, yes, this fix here is for Jaunty (9.04). ImageMagick worked differently on previous version of Ubuntu.

mexpolk said...

Also, I might point that you should install 2.11 cause 2.12 can't compile.

Rob Britton said...

@mexpolk: I just tried updating, it works fine. However I got rmagick-2.12.1, maybe they realized that they shipped a non-working version and fixed it right away.
After testing with -v=2.12 it does indeed give a compile error, but it looks to me like they fixed the issue.