Gem 当一个 gem 在 rubygem.org 可以搜到,但是在 Rails 中安装这个 gem 时,却提示找不到

levan · May 04, 2012 · Last by Ddl1st replied at May 07, 2012 · 5773 hits

请问这个该怎么解决? gem install rmgick -v '2.13.1' ERROR: Could not find a valid gem 'rmgick' (= 2.13.1) in any repository ERROR: Possible alternatives: rmagick, rmilk

[打错了...rmagick,但事后还有点问题,自己搜去了...谢谢帮助]

search for rmgick No entries found

是使用了 rvm 来管理 gem 包吗?如果是的话,可能在 rvm 中有了这个 gem 的 gemspec,然后 rvm 不再去下载。

@Rei 请教 root@SNDA-192-168-1-95:~# gem install rmagick -v '2.13.1' Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for Ruby version >= 1.8.5... yes extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config. checking for gcc... yes checking for Magick-config... no Can't install RMagick 2.13.1. Can't find Magick-config in /usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

*** 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=/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby

Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1 for inspection. Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

是 rmagick 吧?

由于国内网络原因(你懂的),导致 rubygems.org 存放在 Amazon S3 上面的资源文件间歇性连接失败。所以你会与遇到 gem install foo 或 bundle install 的时候半天没有响应....

http://ruby.taobao.org/

@lgn21st 我貌似已经用了 taobao 的源了... root@SNDA-192-168-1-95:~# gem sources -l *** CURRENT SOURCES ***

http://ruby.taobao.org

是 rmgick 还是 rmagick ?? O_o 细心看看嘛~ 别一遇到问题就慌:)

猜测:imagemagick 这个开发包装了没有?如: ubuntu: apt-get install imagemagick


假设你使用 .rvm。 如果你在安装 ruby : rvm install 1.9.3 之前没有安装 wiki 里的各种包, 那么你需要在安装那些依赖包后在重新安装一次 ruby

@lgn21st @cantin @skandhas 我错了...打扰了...这两天...没事就冒出些问题,搞得比较烦烦躁... 没仔细看,下次不会冒出这些问题了. 打扰了~thx

@ichord 是按照 wiki 来的,但是你刚刚说的那个 imagemagick 不知为何没装到...那我再重弄一次吧.thx~

#3 楼 @Levan 这和你的那个 mysql 问题类似,@ichord 说的对,应该是你的 iamgemagick 没有装吧

以后安装 native gem 时,如果这个 gem 依赖其他程序,那么先要把 gem 所依赖的程序和开发环境装好,然后再安装 gem。

@skandhas 那就是同一类的问题吧,mysql,我在 mac 上没安好,换了 ubantu,先装好了 mysql,再安装 native gem,那个应该算解决了.thx~

apt-get install libmagick9-dev

You need to Sign in before reply, if you don't have an account, please Sign up first.