RMagick 是 ImageMagick 的 wrapper,因此先安裝 imagemagick 是一定要的。在這裡我們使用 Homebrew 來安裝:
$ brew install imagemagick
接著
$ gem install rmagick
然後打開 irb 測試一下:
$ irb
ruby-1.9.2-p290 :002 > require 'RMagick'
=> true
ruby-1.9.2-p290 :004 > include Magick
=> Object
ruby-1.9.2-p290 :005 > cat = ImageList.new("your-image-path")
=> ['your-image-information']
scene=0
ruby-1.9.2-p290 :006 > cat.display
看到圖就 ok 啦~
Reference:
http://studio.imagemagick.org/RMagick/doc/usage.html
http://stackoverflow.com/questions/3894225/imagemagick-rmagick-cant-install-rmagick-2-13-1-cant-find-magick-config
$ brew install imagemagick
接著
$ gem install rmagick
然後打開 irb 測試一下:
$ irb
ruby-1.9.2-p290 :002 > require 'RMagick'
=> true
ruby-1.9.2-p290 :004 > include Magick
=> Object
ruby-1.9.2-p290 :005 > cat = ImageList.new("your-image-path")
=> ['your-image-information']
scene=0
ruby-1.9.2-p290 :006 > cat.display
看到圖就 ok 啦~
Reference:
http://studio.imagemagick.org/RMagick/doc/usage.html
http://stackoverflow.com/questions/3894225/imagemagick-rmagick-cant-install-rmagick-2-13-1-cant-find-magick-config
留言
張貼留言