问题描述
我刚刚转到Ubuntu 8.10作为我的开发盒;这是我作为日常使用的操作系统进入Linux的第一次严重尝试,而且我很难让Rails进入。我遵循了许多教程,这些教程似乎都能正常工作,但是当我尝试使用gem install或gem update进行更新时,出现如下错误:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`gem_original_require':no such file to load - zlib(LoadError)$ b $ / 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。从/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`gem_original_require'
从/usr/local/lib/ruby/site_ruby/1.8获取rb:1
在/ usr / local / lib / rubygems / lib / ruby / site_ruby / 1.8 / rubygems / custom_require.rb:31:在`gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`require' $ / b / b来自/usr/local/lib/ruby/site_ruby/1.8/rubyg ems / command_manager.rb:167:`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'$ / b / b from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:`run'
from /usr/local/lib/ruby/site_ruby/1.8 /rubygems/gem_runner.rb:58:从`/ usr / local / bin / gem`运行
:
我有(如教程中推荐的)安装了zlib,zlib1g和zlib1g-dev。我甚至发现了一些关于这个特定问题的教程(但是,除了我之外,其他所有的教程都是这样),但他们没有帮助。
我在Ubuntu 8.10 ,红宝石版本1.8.8dev宝石版本1.3.2
我已经尝试重新安装红宝石和宝石的每个和分开,没有用。
如果你遇到这个问题,试图在Ubuntu 10.04上使用Ruby Version Manager(RVM)来安装Ruby,那么有关于在rvm网站上安装zlib的说明,请参见
a href =http://rvm.beginrescueend.com/packages/zlib/ =noreferrer> http://rvm.beginrescueend.com/packages/zlib/
步骤如下:
rvm pkg install zlib
$ b (或
rvm package install zlib
如果您收到错误:无法识别的命令在线参数:'pkg' - 旧版本的rvm改用动词'package')
然后
rvm remo ve 1.9.1
rvm install 1.9.1
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
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.
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.
解决方案 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/
The steps are:
rvm pkg install zlib
(or rvm package install zlib
if you get "ERROR: Unrecognized command line argument: 'pkg'" - older versions of rvm used the verb 'package' instead)
then
rvm remove 1.9.1
rvm install 1.9.1
这篇关于在zlib上Ubuntu noob rails安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!