Ubuntu Rails安装在zlib上失败 [英] Ubuntu rails install fails on zlib

查看:90
本文介绍了Ubuntu Rails安装在zlib上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将开发箱移至Ubuntu 8.10.这是我第一次将Linux作为日常使用的OS进行认真的尝试,而我很难让Rails正常运行.我遵循了许多似乎都可以正常工作的教程,但是当我尝试对任何东西使用gem install或gem update时,都会出现如下错误:

I've just moved over to Ubuntu 8.10 as my dev box; it's my first serious foray into Linux as a daily-use OS, and I'm having a hard time getting Rails going. I have followed a number of tutorials which all seem to work fine, but when I try and use gem install or gem update on anything, I get an error that looks like this:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- zlib (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:1
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb:5
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:167:in `load_and_instantiate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:88:in `[]'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:144:in `find_command'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:131:in `process_args'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in `run'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
from /usr/local/bin/gem:21

我已经(按照教程中的建议)安装了zlib,zlib1g和zlib1g-dev.我什至找到了一些有关此特定问题的教程(但是,除了我的口味以外,其他所有教程都没有用),但是它们并没有帮助.

I have (as recommended in the tutorials) installed zlib, zlib1g, and zlib1g-dev. I've even found a few tutorials on this particular problem (all for flavors other than mine, however) but they didn't help.

我使用的是Ubuntu 8.10,Ruby版本1.8.8dev gem版本1.3.2

I'm on Ubuntu 8.10, ruby version 1.8.8dev gem version 1.3.2

我尝试分别重新安装红宝石和宝石,无济于事.

I've tried reinstalling ruby and gems each and separately, to no avail.

推荐答案

如果您遇到此问题,尝试在Ubuntu 10.04上使用Ruby Version Manager(RVM)安装Ruby,则有在rvm网站上安装zlib的说明 http://rvm.beginrescueend.com/packages/zlib/

If you come across this question trying to install Ruby using Ruby Version Manager (RVM) on Ubuntu 10.04 then there are instructions on installing zlib on the rvm web site http://rvm.beginrescueend.com/packages/zlib/

步骤是:

rvm pkg install zlib

(如果您收到错误:无法识别的命令行参数:'pkg'",则返回 rvm package install zlib-较早版本的rvm使用动词"package")

(or rvm package install zlib if you get "ERROR: Unrecognized command line argument: 'pkg'" - older versions of rvm used the verb 'package' instead)

然后

rvm remove 1.9.1
rvm install 1.9.1

这篇关于Ubuntu Rails安装在zlib上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆