新手问题 CentOS 下 gem sources 新增镜像遇到的报错,是缺少什么包所导致吗?

DeMo · 2013年03月21日 · 最后由 DeMo 回复于 2013年03月21日 · 2611 次阅读

跟从地址http://ruby-china.org/wiki/install_ruby_guidegem的方式进行,理解 sources 的用法,但不知道为什么我新增镜像时会遇到这样的问题,推荐的所有镜像都无法新增。 ``gem sources -a http://gems.rubyforge.org /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire': cannot load such file -- zlib (LoadError) from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems.rb:540:ingunzip' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/remote_fetcher.rb:239:in fetch_path' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:269:inload_specs' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/commands/sources_command.rb:72:in execute' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:ininvoke' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:147:in process_args' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:117:inrun' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:65:in run' from /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/gem:25:in

'

require': cannot load such file -- zlib,谷歌一下

非常感谢!在 http://stackoverflow.com/questions/9727908/cannot-load-such-file-zlib-even-after-using-rvm-pkg-install-zlib 中找到一个非常实用的命令:rvm requirements,可以帮助把 ruby 需要用的包都安装了。

#1 楼 @chenge 通过命令: rvm requirements 安装所有了 rvm、ruby 所需的所有依赖包,该问题已经解决。再次感谢!

需要 登录 后方可回复, 如果你还没有账号请 注册新账号