ruby - 如何在ubuntu中安装指定版本的Ruby

标签 ruby linux ubuntu apt

这个问题在这里已经有了答案:





How to install version specified Ruby using apt

(2 个回答)


1年前关闭。




我尝试安装指定版本为 2.5.1 的 Ruby(该版本只是示例),并尝试了以下脚本,但出现如下错误。是否可以使用 apt 安装的版本安装 Ruby,以便我可以处理 Ruby 版本依赖问题?

$ sudo apt update ; sudo apt install ruby-full=2.5.1
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://ppa.launchpad.net/kelleyk/emacs/ubuntu bionic InRelease                                            
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease       
Hit:6 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease                                              
Hit:7 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease                                            
Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease                                               
Hit:9 http://ppa.launchpad.net/teejee2008/timeshift/ubuntu bionic InRelease
Fetched 64.4 kB in 2s (41.9 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
40 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '2.5.1' for 'ruby-full' was not found```

最佳答案

您可以安装rbenv这是一个 Ruby 环境,然后您可以在其上安装所需的 Ruby 版本。
引用这个answer

关于ruby - 如何在ubuntu中安装指定版本的Ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64844073/

相关文章:

linux - 为什么 telnet 和 nmap 不反射(reflect)我为 ec2 安全组关闭的端口?

ubuntu - 使用带有正则表达式的 Sed 进行子字符串替换

mysql - 是否可以通过 ON DUPLICATE KEY UPDATE 强制 Sequel 始终返回自动增量 id?

ruby - 在 Chef Recipe 中干燥

ruby-on-rails - 不能在前置模块中使用实例变量

r - 安装软件包 R (Ubuntu)

node.js - 如何使用 Node JS 或命令行将图像从服务器复制到本地

ruby-on-rails - Rails 4 用户角色和权限

c - 使用 read() 和指向缓冲区的指针从字符设备读取

linux - 如何撤消其他人 checkin 的已删除中继?