【问题标题】:How to install version specified Ruby in ubuntu [duplicate]如何在ubuntu中安装指定的Ruby版本[重复]
【发布时间】:2020-11-15 11:54:12
【问题描述】:

我尝试安装指定版本为 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```

【问题讨论】:

  • 在您提出问题之前,请确保确认该问题之前没有被提出过。这个完全相同的问题已经被问过并得到了回答,所以完全没有必要重复它。事实上,已经存在一个逐字母相同的问题,其答案与您接受的答案逐字母相同。

标签: ruby linux ubuntu apt


【解决方案1】:

您可以安装 rbenv 这是一个 Ruby 环境,然后您可以在上面安装您想要的 Ruby 版本。

参考这个answer

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-15
    • 1970-01-01
    • 1970-01-01
    • 2012-02-06
    • 2022-01-23
    • 2018-03-25
    • 1970-01-01
    相关资源
    最近更新 更多