views:

182

answers:

4

Hey all -

I'm trying to get RMagick setup on Ubuntu 10.04. Looked here but had no joy. I even compiled and installed ImageMagick from source, but the instructions here still didn't help me when I try to install RMagick using RubyGems. I got this error:

carcher@carcher-laptop:~/Code/temp/RMagick-2.13.1$ sudo gem install rmagick
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
 ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
 from extconf.rb:1


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
carcher@carcher-laptop:~/Code/temp/RMagick-2.13.1$ 

What does it all mean? :) I'm new to Ruby and RubyGems so please be gentle. My setup is as follows:

Ruby: 1.8.7
RubyGems: 1.3.7

I'm pretty much out of ideas (and tired too!). I tired to compile RMagick from source using the link above but it failed as there was no ./configure script :(

Any and all help appreciated!

A: 

sudo apt-get install build-essential

Mark Thomas
No joy: 'build-essential is already the newest version.'
Ciaran Archer
A: 

If you want to try installing the native deb package instead of the gem, be aware that the librmagick-ruby was broken on Ubuntu 10.04 until just very recently:

https://bugs.launchpad.net/ubuntu/+source/librmagick-ruby/+bug/518122

See comment #17 in particular. I believe this has already been fixed so now apt-get install librmagick-ruby might "just work". Otherwise here's how to build it yourself from source

$ cd /usr/src
$ sudo apt-get build-dep librmagick-ruby
$ sudo apt-get source librmagick-ruby
$ cd librmagick-ruby-2.11.1
$ sudo dch -i
(add changelog entry)
$ sudo dpkg-buildpackage
$ cd ..
$ sudo dpkg -i librmagick-ruby*.deb
Peter Lyons
+2  A: 

You got message extconf.rb:1:in 'require': no such file to load -- mkmf (LoadError) because package ruby1.8-dev isn't installed. Install it (sudo apt-get install ruby1.8-dev) and try again.

antage
No luck - ruby1.8-dev is already the newest version.
Ciaran Archer
+1  A: 

Install the packages imagemagick and libmagickwand-dev (or libmagick9-dev). You should then be able to install the Rmagick Gem.

If not, you are missing ruby related development packages like build-essential and ruby1.8-dev. If that's the case, a generic "ubuntu install ruby 1.8" query in google should sort you out.

gcahill
This (imagemagick and libmagickwand-dev) appears to have worked and I can see RMagick 2.13.1 as one of my listed gems!
Ciaran Archer