Harsha M V Harsha M V - 3 months ago 47
Ruby Question

There was an error while trying to load the gem 'rmagick'. (Bundler::GemRequireError)

rails s
/Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'rmagick'. (Bundler::GemRequireError)
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /Users/harshamv/Sites/platehopper/config/application.rb:7:in `<top (required)>'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:79:in `require'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/harshamv/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'


When i am trying to run rails server am getting the above error

Answer

The accepted answer is out of date. I ran into this issue on Mac OSX (El Capitan) and ImageMagick (6.9.4). I resolved it by reverting back to an older version of ImageMagick and reinstalling rmagick as follows:

brew uninstall --force imagemagick

Note: I had to use --force because of multiple, old versions installed. You could also just run the command multiple times if you're worried about the --force option.

brew tap homebrew/versions
brew install https://raw.githubusercontent.com/Homebrew/homebrew-versions/master/imagemagick-ruby186.rb
gem uninstall rmagick
gem install rmagick -v 2.15.0
Comments