:note

bundlerでインストールしたgemの再インストール

homebrewでimagemagickをアップグレードしたので、rmagickを再インストール(with native extension)したい。

bundlerにはreinstallコマンドとかはないので、 bundle exec 付きで gem uninstall してbundle installする。

% bundle exec rake -T
rake aborted!
LoadError: dlopen(/Users/milligramme/play/nice_task/vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib
  Referenced from: /Users/gdansk/play/nice_tasmilligrammeor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/lib/RMagick2.bundle
  Reason: image not found - /Users/gdansk/play/nice_task/vendor/bundle/rubymilligramme/gems/rmagick-2.16.0/lib/RMagick2.bundle
/Users/gdansk/play/nice_task/vendor/bundle/ruby/2.3.0/gems/rmagick-milligramme/lib/rmagick_internal.rb:12:in `require'
/Users/gdansk/play/nice_task/vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/lib/rmagick_imilligrammel.rb:12:in `<top (required)>'
/Users/gdansk/play/nice_task/vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/lib/rmagick.rb:1:in `require'
/Usmilligrammeansk/play/nice_task/vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/lib/rmagick.rb:1:in `<top (required)>'
/Users/gdansk/milligrammeice_task/Rakefile:2:in `require'
/Users/gdansk/play/nice_task/Rakefile:2:in `<top (required)>'
/Users/gdansk/play/nice_task/venmilligrammendle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
milligramme/gdansk/.rbenv/versions/2.3.2/bin/bundle:22:in `load'
/Users/gdansk/.rbenv/vmilligrammes/2.3.2/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)

% bundle exec gem uninstall rmagick
Sumilligrammeully uninstalled rmagick-2.16.0

% bundle install
Fetcmilligrammeem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/
Using rake 12.0.0
Using bundler 1.13.6
Installing rmagick 2.16.0 with native extensions
Bundle complete! 3 Gemfile dependencies, 3 gems now installed.
Bundled gems are installed into ./vendor/bundle.

ImageMagickは v7 でコマンドとかオプションが変わるようなので、homebrewうっかりでアップグレードしないように気をつける

 
comments powered by Disqus
back to top