如何在 ubuntu 19.04 上安装 rvm install 2.1.1

How to install rvm install 2.1.1 on ubuntu 19.04

在 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.

目前,无法再在最近的 Ubuntu 上安装旧的红宝石。如果你需要 运行 旧红宝石,我建议你坚持使用 Ubuntu 18.04 LTS,你仍然可以在其上安装任何你想要的 ruby。

2.1.x、2.2.x 和 2.3.x 不再安装在 19.04

我们需要一个自定义的 openssl 1.1 补丁,我不确定是否有人会处理这个问题。大多数 ruby 社区已准备好继续前进。

对于生产环境,您一定要坚持使用 LTS 版本。

当 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/

从 Ubuntu 19.04 开始,rvm install 2.4.6 是您最早的选择, rvm install 2.6.3 为当前推荐版本

我的 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 ]

在我的 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 ]

希望对您有所帮助

您可以按照此 RVM github 问题上发布的说明安装以前版本的 Ruby:https://github.com/rvm/rvm/issues/4680#issuecomment-515951866

I did the same as @grhansen suggested. I was installing ruby 2.3 and that required libssl1.0-dev. I am using Ubuntu 19.04. So I opened my /etc/apt/sources.list by

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.

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:已安装:(none)候选人: 1.0.2n-1ubuntu5.3 版本 table: 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:已安装:(none) 候选人:(none)版本table: