简体   繁体   English

使用rvm安装最新的RUBY会在Ubuntu上出错

[英]Installing latest RUBY with rvm gives error on Ubuntu

Getting the following error when im trying to install ruby-2.1.2 我试图安装ruby-2.1.2时出现以下错误

rvm install ruby-2.1.2
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/12.04/x86_64/ruby-2.1.2.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system................
Error running 'requirements_debian_update_system ruby-2.1.2',
showing last 15 lines of /usr/local/rvm/log/1400060285_ruby-2.1.2/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.
For 404 errors 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.
For 404 errors check your sources configured in:
    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list
++ return 100
sudo apt-get install gawk g++ gcc make libc6-dev libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev

I think your rvm is older version, 我认为你的rvm是旧版本,

Install the latest (v1.25.25) rvm using: 使用以下命令安装最新的(v1.25.25)rvm:

$ \\curl -L https://get.rvm.io | bash -s stable --ruby

then check the rubies available with this version: 然后检查此版本可用的红宝石:

$ rvm list known

then install the latest: 然后安装最新的:

$ rvm install ruby-2.1.2

Note: Even if it does not show up in rvm list known it will try to download with the following message: 注意:即使它没有显示在rvm list known它也会尝试使用以下消息进行下载:

Installing Ruby from source to: /home/<YOUR_USER_NAME>/.rvm/rubies/ruby-2.1.2, this may take a while depending on your cpu(s)...

This error in my case was cased because apt-get update gave an error. 在我的情况下这个错误是因为apt-get update出错了。 After doing and manual sudo apt-get update I notices that one of the repos gave an error "W: Failed to fetch". 在做了手动sudo apt-get update之后,我注意到其中一个repos发出错误“W:无法获取”。 After editing the repo list and removing the one that gave the error I was able to install. 编辑了repo列表并删除了导致错误的列表后我就能安装了。

Try to use this for install latest ruby 尝试使用它来安装最新的ruby

rvm mount -r https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-1.9.3-p194.tar.bz2

for more help 寻求更多帮助

rvm help mount

I tried most of above answers but none works for me, so i just change server If you are using rvm for ruby then this will work. 我尝试了上面的大部分答案,但没有一个适合我,所以我只是更改服务器如果你使用rvm为ruby然后这将工作。

  1. Goto directory etc/apt 转到目录etc / apt
  2. click on Sources.list 点击Sources.list
  3. Change the server to us or some else server 将服务器更改为我们或其他服务器
  4. Reload (it will update your cache from that server) 重新加载(它将从该服务器更新您的缓存)
  5. Then run sudo apt-get update 然后运行sudo apt-get update
  6. Finally run rvm install 2.3.0 最后运行rvm install 2.3.0

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

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