Trying to get Ruby 1.9.1 up and running with RVM on a fresh install (fedora).
尝试将Ruby 1.9.1升级并在一个新的安装上运行RVM (fedora)。
After doing rvm install 1.9.1
, the rubygems error logs show that zlib can't be located
在执行rvm安装1.9.1之后,rubygems错误日志显示zlib无法定位。
no such file to load -- zlib (LoadError)
不加载此类文件——zlib (LoadError)
However both the zlib runtime and development libraries are installed and up-to-date.
然而,zlib运行时和开发库都已安装并是最新的。
I'm kinda stumped on this one at the moment.
我现在被这个问题难住了。
8 个解决方案
#1
108
Use rvm to install zlib
使用rvm安装zlib
https://rvm.io/packages/zlib/
rvm package install zlib
rvm remove 1.9.1
rvm install 1.9.1 -C --with-zlib-dir=$rvm_path/usr
Edit: The rvm package
command was renamed to rvm pkg
in v1.6.25.
编辑:rvm包命令在v1.6.25中被重命名为rvm pkg。
#2
63
You need to install zlib
before compiling/installing Ruby. If you didn't do this, make sure to remove everything related to Ruby 1.9.1 from your ~/.rvm
folder (so that it will be build from scratch).
在编译/安装Ruby之前,您需要安装zlib。如果您没有这样做,请确保从您的~/中删除与Ruby 1.9.1相关的所有内容。rvm文件夹(以便从头构建)。
Install zlib
using your favorite package manager:
使用您最喜欢的包管理器安装zlib:
sudo apt-get install zlib1g-dev
You might also want to install the following packages as they are required by tools like OpenSSL,
Nokogiri, IRB or SQLite:
您可能还希望安装以下包,因为这些包是OpenSSL、Nokogiri、IRB或SQLite等工具所需要的:
libssl-dev libreadline6-dev libxml2-dev libsqlite3-dev
Then install Ruby 1.9.1 again (nowadays I would suggest to use a newer version):
然后再次安装Ruby 1.9.1(现在我建议使用更新的版本):
rvm install 1.9.1
Watch for "compiling ...". This should take a while. If it doesn't, then Ruby 1.9.1 might still be cached
in your ~/.rvm
folder.
关注“编译…”。这需要一段时间。如果没有,那么Ruby 1.9.1可能仍然会缓存到您的~/中。rvm文件夹。
#3
9
I encountered this problem when trying to:
我在尝试:
gem install gruff
gem安装生硬地
What actually worked for me (Ubunut 10.10, ruby MRI 1.8.7) is:
实际上对我有用的(Ubunut 10.10, ruby MRI 1.8.7)是:
- reading the rvm notes and installing the dependencies for my ruby version
- 读取rvm注释并为我的ruby版本安装依赖项。
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev autoconf
sudo apt-get安装build-essential bison openssl libreadline6 libreadline6 libreadline6-dev curl git-core zlib1g zlib1g zlib1g zlib1g zlib1g-dev libssld -dev libsqlite3-dev sqlite3-dev sqlite3 libxml2-dev autoconf。
- then following closely the steps described in https://rvm.io/packages/zlib/
- 然后严格遵循https://rvm.io/packages/zlib/中描述的步骤
- rvm package install zlib
- rvm包安装zlib
- rvm remove 1.8.7
- rvm删除1.8.7
- rvm install 1.8.7
- rvm安装1.8.7
So basically: just follow the rvm manual
基本上,只要遵循rvm手册
#4
3
In modern version of rvm package argument have been replaced pkg argument.
在现代版本的rvm包参数中已经替换了pkg参数。
Now, in order to install zlib package for rvm need:
现在,为了安装rvm需要的zlib包:
rvm pkg install zlib
rvm pkg安装zlib
#5
1
Since you are using Fedora try running:
既然您正在使用Fedora,请尝试运行:
yum install zlib-devel.i686
And then try installing ruby 1.9.1 using RVM
然后尝试使用RVM安装ruby 1.9.1。
rvm install 1.9.1
#6
1
Also, you do know that 1.9.1 is horribly broken which is why no one uses it seriously, right? The importance this has to the question asked is that many people do not realize this and attempt to use it with such APIs as Ruby On Rails. However, as rubyonrails.org/download states, Ruby 1.9.1 is not supported for use with Rails as it is broken.
你也知道1。9。1被严重破坏了这就是为什么没有人认真使用它的原因,对吧?这个问题的重要性在于,许多人没有意识到这一点,并试图将它与Ruby On Rails等api结合使用。然而,正如rubyonrails.org/download所言,Ruby 1.9.1不支持Rails,因为它已经崩溃了。
#7
1
On the latest Ubuntu (11.10) there is also an issue with readline.
在最新的Ubuntu(11.10)中,readline也存在问题。
Readline was unable to be required, if you need completion or history install readline then reinstall ruby.
如果您需要完成或历史安装Readline然后重新安装ruby, Readline是无法被要求的。
So my entire rvm and latest ruby install process for ubunutu 11.10 was:
所以我的整个rvm和ubunutu 11.10的最新ruby安装过程是:
# install rvm
sudo apt-get install curl
curl -L get.rvm.io | bash -s stable
# install dependencies
rvm pkg install zlib
rvm pkg install readline
# install additional dependencies -- follow instructions for your distribution/version
rvm requirements
# install ruby
rvm install [ruby-version]
I'm posting this for my future reference and in case anyone else bumps into this issue as well.
我将这篇文章作为我未来的参考,万一有人遇到这个问题。
#8
0
For me, the solution was very simple: I had forgotten to close/reopen the shell, as rvm setup had instructed me to do. After I did that, the zlib error was gone and I was able to: gem install bundler
对我来说,解决方案非常简单:我忘记了关闭/重新打开shell,这是rvm设置指示我这样做的。在我这样做之后,zlib错误消失了,我可以:gem安装bundler
#1
108
Use rvm to install zlib
使用rvm安装zlib
https://rvm.io/packages/zlib/
rvm package install zlib
rvm remove 1.9.1
rvm install 1.9.1 -C --with-zlib-dir=$rvm_path/usr
Edit: The rvm package
command was renamed to rvm pkg
in v1.6.25.
编辑:rvm包命令在v1.6.25中被重命名为rvm pkg。
#2
63
You need to install zlib
before compiling/installing Ruby. If you didn't do this, make sure to remove everything related to Ruby 1.9.1 from your ~/.rvm
folder (so that it will be build from scratch).
在编译/安装Ruby之前,您需要安装zlib。如果您没有这样做,请确保从您的~/中删除与Ruby 1.9.1相关的所有内容。rvm文件夹(以便从头构建)。
Install zlib
using your favorite package manager:
使用您最喜欢的包管理器安装zlib:
sudo apt-get install zlib1g-dev
You might also want to install the following packages as they are required by tools like OpenSSL,
Nokogiri, IRB or SQLite:
您可能还希望安装以下包,因为这些包是OpenSSL、Nokogiri、IRB或SQLite等工具所需要的:
libssl-dev libreadline6-dev libxml2-dev libsqlite3-dev
Then install Ruby 1.9.1 again (nowadays I would suggest to use a newer version):
然后再次安装Ruby 1.9.1(现在我建议使用更新的版本):
rvm install 1.9.1
Watch for "compiling ...". This should take a while. If it doesn't, then Ruby 1.9.1 might still be cached
in your ~/.rvm
folder.
关注“编译…”。这需要一段时间。如果没有,那么Ruby 1.9.1可能仍然会缓存到您的~/中。rvm文件夹。
#3
9
I encountered this problem when trying to:
我在尝试:
gem install gruff
gem安装生硬地
What actually worked for me (Ubunut 10.10, ruby MRI 1.8.7) is:
实际上对我有用的(Ubunut 10.10, ruby MRI 1.8.7)是:
- reading the rvm notes and installing the dependencies for my ruby version
- 读取rvm注释并为我的ruby版本安装依赖项。
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev autoconf
sudo apt-get安装build-essential bison openssl libreadline6 libreadline6 libreadline6-dev curl git-core zlib1g zlib1g zlib1g zlib1g zlib1g-dev libssld -dev libsqlite3-dev sqlite3-dev sqlite3 libxml2-dev autoconf。
- then following closely the steps described in https://rvm.io/packages/zlib/
- 然后严格遵循https://rvm.io/packages/zlib/中描述的步骤
- rvm package install zlib
- rvm包安装zlib
- rvm remove 1.8.7
- rvm删除1.8.7
- rvm install 1.8.7
- rvm安装1.8.7
So basically: just follow the rvm manual
基本上,只要遵循rvm手册
#4
3
In modern version of rvm package argument have been replaced pkg argument.
在现代版本的rvm包参数中已经替换了pkg参数。
Now, in order to install zlib package for rvm need:
现在,为了安装rvm需要的zlib包:
rvm pkg install zlib
rvm pkg安装zlib
#5
1
Since you are using Fedora try running:
既然您正在使用Fedora,请尝试运行:
yum install zlib-devel.i686
And then try installing ruby 1.9.1 using RVM
然后尝试使用RVM安装ruby 1.9.1。
rvm install 1.9.1
#6
1
Also, you do know that 1.9.1 is horribly broken which is why no one uses it seriously, right? The importance this has to the question asked is that many people do not realize this and attempt to use it with such APIs as Ruby On Rails. However, as rubyonrails.org/download states, Ruby 1.9.1 is not supported for use with Rails as it is broken.
你也知道1。9。1被严重破坏了这就是为什么没有人认真使用它的原因,对吧?这个问题的重要性在于,许多人没有意识到这一点,并试图将它与Ruby On Rails等api结合使用。然而,正如rubyonrails.org/download所言,Ruby 1.9.1不支持Rails,因为它已经崩溃了。
#7
1
On the latest Ubuntu (11.10) there is also an issue with readline.
在最新的Ubuntu(11.10)中,readline也存在问题。
Readline was unable to be required, if you need completion or history install readline then reinstall ruby.
如果您需要完成或历史安装Readline然后重新安装ruby, Readline是无法被要求的。
So my entire rvm and latest ruby install process for ubunutu 11.10 was:
所以我的整个rvm和ubunutu 11.10的最新ruby安装过程是:
# install rvm
sudo apt-get install curl
curl -L get.rvm.io | bash -s stable
# install dependencies
rvm pkg install zlib
rvm pkg install readline
# install additional dependencies -- follow instructions for your distribution/version
rvm requirements
# install ruby
rvm install [ruby-version]
I'm posting this for my future reference and in case anyone else bumps into this issue as well.
我将这篇文章作为我未来的参考,万一有人遇到这个问题。
#8
0
For me, the solution was very simple: I had forgotten to close/reopen the shell, as rvm setup had instructed me to do. After I did that, the zlib error was gone and I was able to: gem install bundler
对我来说,解决方案非常简单:我忘记了关闭/重新打开shell,这是rvm设置指示我这样做的。在我这样做之后,zlib错误消失了,我可以:gem安装bundler