Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 201
pramodtech Avatar asked May 22 '13 06:05

pramodtech


4 Answers

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.

like image 116
toxaq Avatar answered Nov 17 '22 23:11

toxaq


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
like image 7
2 revs Avatar answered Nov 18 '22 01:11

2 revs


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
like image 3
istern Avatar answered Nov 18 '22 01:11

istern


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

like image 1
Mely N Avatar answered Nov 18 '22 00:11

Mely N