gem install rmagickするとchecking for stdint.hでコケる

rmagick死ねカス。

さて、centos5に、ImageMagickが公式バイナリとしてrpmで出している6.6.9を(ImageMagick-develも一緒に)突っ込んである環境下で、rmagickのためにgemでインストールしてみます。ちなみにRuby1.9.2の環境。

[root@samidare ~]# gem install rmagick
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/ruby
/usr/local/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
        from /usr/local/lib/ruby/1.9.1/mkmf.rb:833:in `have_header'
        from extconf.rb:193:in `'

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

まじ、カス。ぐぐると、ruby-list MLにこのような記事が見つかり、同じようにしてみると

# vi /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/extconf.rb

  $LOCAL_LIBS = ENV["LIBS"].to_s     + " " + `Magick-config --libs`.chomp
->  # $LOCAL_LIBS = ENV["LIBS"].to_s     + " " + `Magick-config --libs`.chomp

checking for ....
...
creating extconf.h
creating Makefile

======================================================================
Mon 16May11 01:54:51
This installation of RMagick 2.13.1 is configured for
Ruby 1.9.2 (x86_64-linux) and ImageMagick 6.6.9 Q16
======================================================================

このようにMakefileが生成できた。出来たんだけどmake installじゃないんだろうしmake通っても、どないせいっちゅうねん。

まじrubbishだわ。.bash_profileなどにPATH通したりもしたけどうーんこ。まじうんこ。RMagick非推奨で今後はいこう。個人的には一生ご縁が無いだろうし。

追記;Makefileあった…。 /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/Makefile 、なのでmake && make installしてみたが、、わからん。irbからrequire ‘RMagick’するとerror。もういいや。