Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rmagick preventing rails server from working

I have to use rmagick, and it is not allowing me to start the rails server. I have read around on here and Google, none of the solutions have help so far. There is something going wrong with the Library and I'm not sure how to fix it.

If anyone has advice with fixing this exact problem that would be much appreciated.

/Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `require': dlopen(/Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libltdl.7.dylib (LoadError)
  Referenced from: /usr/local/lib/libMagickCore-Q16.7.dylib
  Reason: image not found - /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/RMagick2.bundle
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `each'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `block in require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `each'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler.rb:132:in `require'
    from /Users/lexi87/dating/config/application.rb:7:in `<top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:53:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
like image 716
pwz2000 Avatar asked Mar 01 '13 16:03

pwz2000


3 Answers

I was able to fix this error, so this should work for anyone else if they're having the same exact problem.

Here are the steps to fixing:

brew uninstall imagemagick
gem uninstall rmagick
sudo gem install json # (not sure this step is needed)
sudo apt-get install libmagick9-dev
bundle install

And then it work perfect. Now I can launch rails server and I receive no more errors. Hope this helps someone!

like image 128
pwz2000 Avatar answered Nov 13 '22 11:11

pwz2000


You just need reinstall rmagick with your current imagemagick

gem install rmagick

In someother issues i found the following fixed the issue by using,

gem pristine rmagick
like image 7
Learner Avatar answered Nov 13 '22 10:11

Learner


I had several problems with my install, what worked for me was

brew uninstall imagemagick
gem uninstall rmagick
brew install imagemagick
bundle install
brew unlink libtool 
brew link libtool

without the first I was getting errors trying to install rmagick and without the last two there were errors starting the rails server

like image 3
Oh_Know Avatar answered Nov 13 '22 12:11

Oh_Know