pramodtech
pramodtech

Reputation: 6270

libMagickCore.so.4: cannot open shared object file: No such file or directory

UPDATE:

gem install rmagick solved the problem.

=====================================

After upgrading my ubuntu to 12.10 when I run my rails application it gives an error

libMagickCore.so.4: cannot open shared object file: No such file or directory - /home/pramod/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.2/lib/RMagick2.so

below path exists in my system.

/home/pramod/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.2/lib/RMagick2.so

I'm new to linux and don't have much idea on how to solve it. Any help is much appreciated.

Upvotes: 10

Views: 10309

Answers (5)

RajaRaviVarma
RajaRaviVarma

Reputation: 2742

In my case I had all the native libraries installed under vendor/bundle, because we use bundle install --deployment on our servers.

In this setup neither gem pristine rmagick nor gem uninstall rmagick; gem install vendor/cache/rmagick-<version>.gem helped.

I had to remove vendor/bundle and do a bundle install --deployment again rm -r vendor/bundle; bundle install --deployment.

These commands should be run from the root directory of the rails application.

Upvotes: 0

Mely N
Mely N

Reputation: 11

I had the same issue, upgrading to version 2.15.3 worked for me

Upvotes: 1

istern
istern

Reputation: 99

This worked for me (although also tried export and gem reinstall solutions, which might have also helped, but didn't do the complete job...):

ldconfig /usr/local/lib

Upvotes: 3

aashish
aashish

Reputation: 2603

Add the following to .bashrc any try again

export LD_LIBRARY_PATH=/usr/local/lib

if, the above command does not work means the install ImageMagick to configured with rmagick. Try,

   gem uninstall rmagick
   gem install rmagick

Upvotes: 7

toxaq
toxaq

Reputation: 6838

When you upgrade you can lose the reference to library file in a compiled gem. To resolve this just recompile the gem (the rmagick gem in this case). Depending on your server setup you can do this with gem pristine rmagick or bundle exec gem pristine rmagick when using bundler.

Upvotes: 25

Related Questions