简体   繁体   English

使用 RVM 在 Ubuntu 10.10 上安装 Ruby,gem 有问题

[英]Installing Ruby on Ubuntu 10.10 using RVM, problem with gem

I've decided to start fresh with ubuntu 10.10.我决定重新开始使用 ubuntu 10.10。 I started with installing git and then installing rvm from the git repo.我从安装 git 开始,然后从 git repo 安装 rvm。 everything worked fine and I compiled and install ruby 1.8.7 and ruby 1.9.2一切正常,我编译并安装了 ruby​​ 1.8.7 和 ruby​​ 1.9.2
the gem is also installed and I run gem -v还安装了 gem,我运行 gem -v
but when run gem list or gem install rake I get the following error但是当运行 gem list 或 gem install rake 时,我收到以下错误

ERROR:  Loading command: list (LoadError)
no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
uninitialized constant Gem::Commands::ListCommand

any idea how to solve this issue?知道如何解决这个问题吗? I also tried sudo apt-get install zlib1g zlib1g-dev build-essential libpq-dev with no luck我也试过sudo apt-get install zlib1g zlib1g-dev build-essential libpq-dev没有运气

When using rvm you can simple do steps that are shown here: link text使用 rvm 时,您可以简单地执行此处显示的步骤:链接文本

$ rvm pkg install zlib (or, older format, rvm package install zlib ) $ rvm pkg install zlib (或者,旧格式, rvm package install zlib

$ rvm remove 1.9.2
$ rvm install 1.9.2 --with-zlib-dir=~/.rvm/usr

或者,如果使用 rvm,只需在安装 zlib1g-dev 后重新安装 ruby​​ 版本。

Try the following in your Ruby source after installing zlib1g-dev:安装 zlib1g-dev 后,在您的 Ruby 源代码中尝试以下操作:

cd ext/zlib
ruby extconf.rb
make
sudo make install

Also see: https://rbjl.janlelis.com/19-rubybuntu-1-installing-ruby-and-rails-on-ubuntu另请参阅: https : //rbjl.janlelis.com/19-rubybuntu-1-installing-ruby-and-rails-on-ubuntu

First implode your rvm and try following steps in this link.首先内爆您的 rvm 并尝试按照此链接中的步骤操作。 might help you This might help you.可能会帮助你 这可能会帮助你。 http://www.jaikeerthi.in/2010/11/install-rails-ubuntu/ http://www.jaikeerthi.in/2010/11/install-rails-ubuntu/

Please also see https://github.com/wayneeseguin/rvm/issues/420另请参阅https://github.com/wayneeseguin/rvm/issues/420

I went through personally and verified installation capabilities on multiple distributions and platforms to make sure the process worked as expected.我亲自检查并验证了多个发行版和平台上的安装功能,以确保该过程按预期工作。

The key thing to take away from this is: before you attempt to install any Ruby versions under RVM, you should always read the关键是:在您尝试在 RVM 下安装任何Ruby 版本之前,您应该始终阅读

rvm notes

command as this contains information that is displayed based on the platform you are currently running.命令,因为它包含基于您当前运行的平台显示的信息。 This gives you the list of minimalistic requirements for all versions of a specific Ruby that you will need to install from your package manager.这为您提供了需要从包管理器安装的特定 Ruby 的所有版本的最低要求列表。 Keep in mind that if you plan on using several different versions like, say, an RBX ruby, an MRI ('normal' ruby), or a REE then you should install all those additional prerequisites taking care to carefully read the notes list.请记住,如果您计划使用多个不同的版本,例如 RBX 红宝石、MRI(“正常”红宝石)或 REE,那么您应该安装所有这些附加先决条件,并仔细阅读注释列表。

NOTE: When you first install, or after every upgrade, be sure to execute:注意:首次安装时或每次升级后,请务必执行:

rvm notes

each and every time you upgrade as we place important information regarding gotchas and requirements, as well as workarounds, here.每次升级时,我们都会在此处放置有关问题和要求以及解决方法的重要信息。 We will be creating a 'issues' command for RVM shortly.我们将很快为 RVM 创建一个“问题”命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM