如何在 ubuntu 16.04 中将 ruby​​ 从 2.0.0 更新到 2.2.2?

Posted

技术标签:

【中文标题】如何在 ubuntu 16.04 中将 ruby​​ 从 2.0.0 更新到 2.2.2?【英文标题】:How to update ruby from 2.0.0 to 2.2.2 in ubuntu 16.04? 【发布时间】:2017-07-09 18:14:46 【问题描述】:

我正在使用 ubuntu 16.04、ruby 2.0.0、rails 4.0.13 和 mongoDB 3.4.2。 我想将 ruby​​ 更新到 2.2.2,但出现错误:

Error running 'requirements_debian_update_system ruby-2.2.6',
showing last 15 lines of /home/lakhvir/.rvm/log/1487593522_ruby-2.2.6/update_system.log
++ case "$TERM:-dumb" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
404 errors should be fixed for rvm to proceed. Check your sources configured in:
    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list
\n'
There has been error while updating 'apt-get', please give it some time and try again later.
404 errors should be fixed for rvm to proceed. Check your sources configured in:
    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list

++ return 100
Requirements installation failed with status: 100.

【问题讨论】:

也许这个已经回答的链接可以帮助你? ***.com/questions/23650992/… 您按照哪些步骤进行升级? 当我使用 (sudo apt-get update | grep "Failed") 命令时,我得到 (W:GPG error:repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release: 以下签名无法验证,因为公钥不可用:NO_PUBKEY D68FA50FEA312927 W:存储库'repo.mongodb.org/apt/ubuntuxenial/mongodb-org/3.2 Release'未签名。E:无法获取repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.0/…404 Not Found E:一些索引文件下载失败。它们已被忽略,或使用旧的。) 【参考方案1】:

首先,您应该立即升级您的 Rails 版本: Ruby on Rails 4.0 End of Life was in January 2015.

至于其他错误,apt-get update 似乎以某种方式窒息。在通过 rvm 之前,我会先尝试修复它。

apt-get update

apt-get dist-upgrade

(确保在运行它们之前了解它们的作用)。如果您在那里遇到错误,请确保您的

/etc/apt/sources.list
/etc/apt/sources.list.d/*.list

文件都正确。

【讨论】:

以上是关于如何在 ubuntu 16.04 中将 ruby​​ 从 2.0.0 更新到 2.2.2?的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu16.04中将python3设置为默认

ubuntu16.04中将python3设置为默认

ubuntu16.04中将python3设置为默认

ubuntu16.04中将python3设置为默认

ubuntu16.04中将python3设置为默认

ubuntu 16.04 i386 安装 ruby + bundler + rails ; 搭建简单的网站bitbar