簡體   English   中英

Ruby on Rails RMagick gem install問題

[英]Ruby on Rails RMagick gem install issue

(編輯:請參閱底部的解決方案)我正在制作一個Ruby On Rails項目,我正在嘗試安裝RMagick gem。 使用OS X 10.6,Ruby版本2.0.0p247,Rails 4.0.0,RVM 1.22.12。

當我運行捆綁安裝時,我收到以下錯誤:

...
Installing rmagick (2.13.2) 
Errno::EACCES: Permission denied - /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/g
ems/rmagick-2.13.2/build_tarball.rake
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.

那么我試試這個建議:

Jason-Pathers-MacBook-Pro:BuyABrick jasonpather$ gem install rmagick -v '2.13.2'
ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/gems/rmagick
-2.13.2/build_tarball.rake

那么我試試sudo:

Jason-Pathers-MacBook-Pro:BuyABrick jasonpather$ sudo gem install rmagick -v '2.1
3.2'
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

/Users/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /Users/jasonpather/.rvm
/gems/ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/gems/ruby-2.0.0-p247@global/bin
:/Users/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/gems/
ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/gems/ruby-2.0.0-p247@global/bin:/User
s/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/jasonpather/.rvm/bin:/opt/lo
cal/bin:/opt/local/sbin:/opt/local/lib/postgresql83/bin/:/usr/local/bin:/usr/bin:
/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/jasonpather/.rvm/rubies/ruby-2.0.0-p247/bin/ruby


Gem files will remain installed in /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/g
ems/rmagick-2.13.2 for inspection.
Results logged to /Users/jasonpather/.rvm/gems/ruby-2.0.0-p247/gems/rmagick-2.13.
2/ext/RMagick/gem_make.out

我非常感謝任何幫助。 我在這個網站上看過類似的問題,但沒有一個建議有所幫助。 在安裝RMagick之前是否需要安裝其他軟件包?

編輯:解決方案

我只是用自制軟件安裝imagemagick brew install imagemagick然后sudo gem install rmagick現在bundle install運行正常!

您需要安裝Image Magick( checking for Magick-config... no來自您的日志提示沒有)。

最簡單的方法(因為你在Mac上)是使用Homebrew 安裝Homebrew(按照它在安裝過程中給出的任何說明 - 它們並不多)然后運行:

brew install imagemagick

然后再次運行bundle install

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM