Reputation: 6270
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
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
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
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
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