11

I just wanted to gem install rmagick

and got this:

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

ImageMagick and libmagickwand-dev is already installed.

Using Ubuntu Linux.

Any help?

Yours, Joern.

Joern Akkermann
  • 3,542
  • 8
  • 33
  • 41

2 Answers2

18

use rvm to install ruby (preferred) or use apt-get install ruby ruby-dev

aptitude install build-essential imagemagick libmagickcore-dev libmagickwand-dev
gem install rmagick

--Edit 1--

sudo apt-get install ruby-dev

You will also need ruby-dev (or ruby-full) for successfully compiling the RMagick before gem install.

You Nguyen
  • 9,961
  • 4
  • 26
  • 52
c2h2
  • 11,911
  • 13
  • 48
  • 60
1

sudo apt-get install imagemagick libmagickwand-dev

gem install rmagick

or

in gem file

gem 'rmagick'

then run

bundle install

Jigar Bhatt
  • 4,217
  • 2
  • 34
  • 42
  • This isn't going to help. The OP says those packages are already installed, and is running that command. And anyway, an answer was already accepted **three and a half years ago**. – nobody Jul 21 '14 at 13:25
  • 1
    for some reason, when I added gem 'rmagick' to my gemfile it removed the error could not load rmagic when I start rails, so for that reason, you got my upvote – saadlulu May 19 '19 at 19:37