简体   繁体   English

如何在 ubuntu 19.04 上安装 rvm install 2.1.1

[英]How to install rvm install 2.1.1 on ubuntu 19.04

While installing ruby version 2.1.1 on ubuntu 19.04, getting error -在 ubuntu 19.04 上安装 ruby​​ 版本 2.1.1 时,出现错误 -

rvm install ruby-2.1.1
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/19.04/x86_64/ruby-2.1.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Removing undesired packages: libssl-dev....
Installing requirements for ubuntu.
Updating system....
Installing required packages: libssl1.0-dev....
Error running 'requirements_debian_libs_install libssl1.0-dev',
please read /home/user/.rvm/log/1560773845_ruby-2.1.1/package_install_libssl1.0-dev.log
Requirements installation failed with status: 100.

You can install previous versions of Ruby following this instructions posted on this RVM github issue: https://github.com/rvm/rvm/issues/4680#issuecomment-515951866您可以按照此 RVM github 问题上发布的说明安装以前版本的 Ruby: https ://github.com/rvm/rvm/issues/4680#issuecomment-515951866

I did the same as @grhansen suggested.我按照@grhansen 的建议做了同样的事情。 I was installing ruby 2.3 and that required libssl1.0-dev.我正在安装 ruby​​ 2.3,这需要 libssl1.0-dev。 I am using Ubuntu 19.04.我正在使用 Ubuntu 19.04。 So I opened my /etc/apt/sources.list by所以我打开了我的 /etc/apt/sources.list

sudo nano /etc/apt/sources.list . sudo nano /etc/apt/sources.list

And then add the following line at the end of the file然后在文件末尾添加以下行

deb http://security.ubuntu.com/ubuntu bionic-security main . deb http://security.ubuntu.com/ubuntu bionic-security main

After that I run the command之后我运行命令

sudo apt update

from the terminal.从终端。 Then I run the command然后我运行命令

apt-cache policy libssl1.0-dev

from the terminal and I got the following output从终端,我得到以下输出

libssl1.0-dev: Installed: (none) Candidate: 1.0.2n-1ubuntu5.3 Version table: 1.0.2n-1ubuntu5.3 500 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages libssl1.0-dev:已安装:(无)候选:1.0.2n-1ubuntu5.3 版本表:1.0.2n-1ubuntu5.3 500 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 包

Then I run the command然后我运行命令

sudo apt-get install libssl1.0-dev

And it is installed then然后安装

Before adding I was getting在添加之前我得到了

libssl1.0-dev: Installed: (none) Candidate: (none) Version table: libssl1.0-dev:已安装:(无)候选:(无)版本表:

At this moment, it is no longer possible to install old rubies on recent Ubuntu.目前,无法在最近的 Ubuntu 上安装旧的 rubies。 If you need to run old rubies, I recommend you stick with Ubuntu 18.04 LTS, on which you can still install any ruby you want.如果您需要运行旧的 ruby​​,我建议您坚持使用 Ubuntu 18.04 LTS,您仍然可以在其上安装任何您想要的 ruby​​。

2.1.x, 2.2.x and 2.3.x no longer installs on 19.04 2.1.x、2.2.x 和 2.3.x 不再安装在 19.04 上

We would need a custom openssl 1.1 patch, I'm not sure if someone will work on this.我们需要一个自定义的 openssl 1.1 补丁,我不确定是否有人会解决这个问题。 Most of the ruby community is ready to move forward.大多数 ruby​​ 社区已经准备好继续前进。

For production environment you should stick to LTS releases for sure.对于生产环境,您肯定应该坚持使用 LTS 版本。

When 20.04 LTS comes out, ruby 2.4 will be unsupported by the ruby-core team itself.当 20.04 LTS 发布时,ruby 2.4 将不受 ruby​​-core 团队本身的支持。

https://www.ruby-lang.org/en/news/2019/03/31/support-of-ruby-2-3-has-ended/ https://www.ruby-lang.org/en/news/2019/03/31/support-of-ruby-2-3-has-ended/

From Ubuntu 19.04 and onward, rvm install 2.4.6 is your oldest option, rvm install 2.6.3 is the current recommended release从 Ubuntu 19.04 起, rvm install 2.4.6是您最旧的选项, rvm install 2.6.3是当前推荐的版本

On my Ubuntu 18.04 I have在我的 Ubuntu 18.04 上,我有

ubuntu@ip-w-x-y-z:~$ rvm list 
   ruby-2.0.0-p648 [ x86_64 ]
   ruby-2.1.8 [ x86_64 ]
   ruby-2.2.10 [ x86_64 ]
   ruby-2.2.4 [ x86_64 ]
   ruby-2.3.8 [ x86_64 ]
   ruby-2.4.6 [ x86_64 ]
=* ruby-2.6.3 [ x86_64 ]

On my 19.04 laptop I have在我的 19.04 笔记本电脑上,我有

ubuntu@ip-w-x-y-z:~$ rvm list 
=> ruby-2.4.6 [ x86_64 ]
   ruby-2.5.5 [ x86_64 ]
 * ruby-2.6.3 [ x86_64 ]
   ruby-2.7.0-preview1 [ x86_64 ]

Update for Ubuntu 22.04 -- I could install all rubies from 1.9.3 to 3.1.2 Ubuntu 22.04 的更新——我可以安装从 1.9.3 到 3.1.2 的所有 rubies

For ruby 2.4.x -> 3.0.4, I used openssl 1.1.1g.对于 ruby​​ 2.4.x -> 3.0.4,我使用了 openssl 1.1.1g。 You also have the option to compile without SSL and later install the openssl gem, which is automatically compiled with OpenSSL 3.0.您还可以选择不使用 SSL 进行编译,然后安装 openssl gem,它是使用 OpenSSL 3.0 自动编译的。

For ruby 1.9.3 -> 2.3.8, I used openssl 1.0.2u.对于 ruby​​ 1.9.3 -> 2.3.8,我使用了 openssl 1.0.2u。 You need to build with the option -fPIC otherwise, it won't build.您需要使用 -fPIC 选项进行构建,否则将无法构建。

Download from there https://www.openssl.org/source/old/从那里下载https://www.openssl.org/source/old/

Extract and build like this.像这样提取和构建。

./config --prefix=~/.openssl/openssl-1.0.2u -fPIC
make && make install
rvm install 2.1.10 --movable --with-openssl-dir=$HOME/.openssl/openssl-1.0.2u
mathieu:openssl-1.0.2u :-) (lifebook-wu2) $ cat /etc/issue.net 
Ubuntu 22.04 LTS
mathieu:openssl-1.0.2u :-) (lifebook-wu2) $ rvm list 
   ruby-1.9.3-p551 [ x86_64 ]
=> ruby-2.0.0-p648 [ x86_64 ]
   ruby-2.1.10 [ x86_64 ]
   ruby-2.2.10 [ x86_64 ]
   ruby-2.3.8 [ x86_64 ]
   ruby-2.4.10 [ x86_64 ]
   ruby-2.5.9 [ x86_64 ]
   ruby-2.6.10 [ x86_64 ]
   ruby-2.6.9 [ x86_64 ]
   ruby-2.7.5 [ x86_64 ]
   ruby-2.7.6 [ x86_64 ]
   ruby-3.0.3 [ x86_64 ]
   ruby-3.0.4 [ x86_64 ]
 * ruby-3.1.2 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

mathieu:openssl-1.0.2u :-) (lifebook-wu2) $ 

I think you should try rvm install 2.1.1 instead of rvm install ruby-2.1.1 我认为你应该尝试rvm install 2.1.1而不是rvm install ruby-2.1.1

you can find more about setup for ruby at here: 你可以在这里找到更多关于ruby设置的信息:

https://gorails.com/setup/ubuntu/19.04 https://gorails.com/setup/ubuntu/19.04

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

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