Ruby's rmagick.so error

gmarik 4 min

Arch is cool but you should never panic! )

After Arch’s rmagick library update I got my ruby bindings broken!

$ script/console
...
Exiting
/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/lib/RMagick.so: This version of RMagick was created to run with ImageMagick 6.5.4 (RuntimeError)
but ImageMagick 6.5.6-1 is installed on this system. You should either
   1) Configure and build RMagick for ImageMagick 6.5.6-1, or
   2) download ImageMagick 6.5.4 from file:///usr/share/doc/ImageMagick-6.5.4/index.html and install it.

So lets try to reinstall

$ sudo gem install rmagick -v '1.15.14'
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
  ERROR: Failed to build gem native extension.

/usr/bin/ruby gem_extconf.rb

sh configure 

Configuring RMagick 1.15.14
checking for gcc... gcc
configure: creating ./config.status
config.status: creating Makefile
config.status: creating ext/RMagick/extconf.rb
config.status: creating metaconfig
config.status: creating ext/RMagick/rmagick_config.h
config.status: ext/RMagick/rmagick_config.h is unchanged
configure:

This installation of RMagick 1.15.14 is configured for ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux] and ImageMagick 6.5.6.
RMagick configuration completed successfully.

make
if test -n "/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/lib"; then \
    RUBYLIBDIR=--rbdir="/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/lib"; \
  fi; \
  if test -n "/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/lib"; then \
    RUBYARCHDIR=--sodir="/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/lib"; \
  fi; \
  /usr/bin/ruby setup.rb config $RUBYLIBDIR $RUBYARCHDIR --data-dir=/share
---> lib
---> lib/rvg
<--- lib/rvg
<--- lib
---> ext
---> ext/RMagick
/usr/bin/ruby /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick/extconf.rb
creating Makefile
<--- ext/RMagick
<--- ext
/usr/bin/ruby setup.rb setup
---> lib
---> lib/rvg
<--- lib/rvg
<--- lib
---> ext
---> ext/RMagick
make
make[1]: Entering directory '/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick'
gcc -I. -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick -DRUBY_VERSION=0x186  -I/usr/include/ImageMagick -fPIC   -c rminfo.c
gcc -I. -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick -DRUBY_VERSION=0x186  -I/usr/include/ImageMagick -fPIC   -c rmmain.c
gcc -I. -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick -DRUBY_VERSION=0x186  -I/usr/include/ImageMagick -fPIC   -c rmdraw.c
gcc -I. -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick -DRUBY_VERSION=0x186  -I/usr/include/ImageMagick -fPIC   -c rmilist.c
gcc -I. -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick -DRUBY_VERSION=0x186  -I/usr/include/ImageMagick -fPIC   -c rmutil.c
gcc -I. -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick -DRUBY_VERSION=0x186  -I/usr/include/ImageMagick -fPIC   -c rmfill.c
gcc -I. -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick -DRUBY_VERSION=0x186  -I/usr/include/ImageMagick -fPIC   -c rmimage.c
gcc -shared -o RMagick.so rminfo.o rmmain.o rmdraw.o rmilist.o rmutil.o rmfill.o rmimage.o -L. -L/usr/lib -Wl,-R/usr/lib -L.  -rdynamic -Wl,-export-dynamic  -L/usr/lib -Wl,--hash-style=gnu -Wl,--as-needed -lfreetype -lz  -L/usr/lib -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -lgs -lpng -lfontconfig -lwmflite -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lrsvg-2 -lgdk_pixbuf-2.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lxml2 -lz -lm -lgomp -lpthread -lltdl -Wl,-R -Wl,/usr/lib -L/usr/lib -lruby  -lpthread -ldl -lcrypt -lm   -lc
make[1]: Leaving directory '/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/ext/RMagick'
<--- ext/RMagick
<--- ext
setup.rb: entering post-setup phase...
post-setup.rb: setting up documentation...
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./ext/RMagick Adispatch.rb
/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.so: This version of RMagick was created to run with ImageMagick 6.5.4 (RuntimeError)
but ImageMagick 6.5.6-1 is installed on this system. You should either
    1) Configure and build RMagick for ImageMagick 6.5.6-1, or
    2) download ImageMagick 6.5.4 from file:///usr/share/doc/ImageMagick-6.5.4/index.html and install it.
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.rb:11
  from Adispatch.rb:2:in 'require'
  from Adispatch.rb:2
post-setup.rb: Adispatch.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./ext/RMagick InitialCoords.rb
/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.so: This version of RMagick was created to run with ImageMagick 6.5.4 (RuntimeError)
but ImageMagick 6.5.6-1 is installed on this system. You should either
    1) Configure and build RMagick for ImageMagick 6.5.6-1, or
    2) download ImageMagick 6.5.4 from file:///usr/share/doc/ImageMagick-6.5.4/index.html and install it.
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.rb:11
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31:in 'require'
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31
  from InitialCoords.rb:1:in 'require'
  from InitialCoords.rb:1
post-setup.rb: InitialCoords.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./ext/RMagick NewCoordSys.rb
/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.so: This version of RMagick was created to run with ImageMagick 6.5.4 (RuntimeError)
but ImageMagick 6.5.6-1 is installed on this system. You should either
    1) Configure and build RMagick for ImageMagick 6.5.6-1, or
    2) download ImageMagick 6.5.4 from file:///usr/share/doc/ImageMagick-6.5.4/index.html and install it.
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.rb:11
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31:in 'require'
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31
  from NewCoordSys.rb:1:in 'require'
  from NewCoordSys.rb:1
post-setup.rb: NewCoordSys.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./ext/RMagick OrigCoordSys.rb
/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.so: This version of RMagick was created to run with ImageMagick 6.5.4 (RuntimeError)
but ImageMagick 6.5.6-1 is installed on this system. You should either
    1) Configure and build RMagick for ImageMagick 6.5.6-1, or
    2) download ImageMagick 6.5.4 from file:///usr/share/doc/ImageMagick-6.5.4/index.html and install it.
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.rb:11
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31:in 'require'
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31
  from OrigCoordSys.rb:1:in 'require'
  from OrigCoordSys.rb:1
post-setup.rb: OrigCoordSys.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./ext/RMagick PreserveAspectRatio.rb
/usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.so: This version of RMagick was created to run with ImageMagick 6.5.4 (RuntimeError)
but ImageMagick 6.5.6-1 is installed on this system. You should either
    1) Configure and build RMagick for ImageMagick 6.5.6-1, or
    2) download ImageMagick 6.5.4 from file:///usr/share/doc/ImageMagick-6.5.4/index.html and install it.
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/RMagick.rb:11
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31:in 'require'
  from /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/./lib/rvg/rvg.rb:31
  from PreserveAspectRatio.rb:1:in 'require'
  from PreserveAspectRatio.rb:1
setup.rb:             Too many examples failed. Search for "Help!" at
            http://rmagick.rubyforge.org/install-faq.html.
post-setup.rb: PreserveAspectRatio.rb example returned error code 256
make: *** [all] Error 1


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/rmagick-1.15.14/gem_make.out

Epic failure!

So lets uninstall and reinstall

$ sudo gem uninstall rmagick

Select gem to uninstall:
  1. rmagick-1.15.14
  2. rmagick-1.15.17
  3. rmagick-2.11.1
  4. All versions
> 4
Successfully uninstalled rmagick-1.15.14
Successfully uninstalled rmagick-1.15.17
Successfully uninstalled rmagick-2.11.1

$ sudo gem install rmagick -v '1.15.14'
Building native extensions.  This could take a while...
Successfully installed rmagick-1.15.14
1 gem installed
Installing ri documentation for rmagick-1.15.14...

No definition for Magick_init_formats

....

$ script/console

No errors!! Great success!!

Read More
Readline-6 update and Ruby issues
Vim doesnt' copy/paste from X11 clipboard
Comments
read or add one↓