简体   繁体   中英

RVM fails installing Ruby

I'm trying to install an older Ruby version via RVM but the installation fails with an error I've never seen before. I've already changed the rvm_max_time_flag but it didn't help. What can I do here?

rvm install 1.9.3p484
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3p484.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/nandersen/.rvm/rubies/ruby-1.9.3p484, this may take a while depending on your cpu(s)...
ruby-1.9.3p484 - #downloading ruby-1.9.3p484, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
The requested url does not exist(22): 'http://cache.ruby-lang.org/pub/ruby/./ruby-1.9.3p484.tar.bz2'
Checking fallback: http://ftp.ruby-lang.org/pub/ruby/./ruby-1.9.3p484.tar.bz2
Checking fallback: http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby/./ruby-1.9.3p484.tar.bz2
No fallback URL could be found, try increasing timeout with:

    echo "export rvm_max_time_flag=20" >> ~/.rvmrc

There has been an error fetching the ruby interpreter. Halting the installation.

1) 确保您使用的是最新的 RVM rvm get head 2) 然后安装新的 ruby rvm install ruby-2.3

It says that the URL does not exist OR the URL has no ruby version available for download.

Try installing with a compatible ruby-gem version:

rvm install 1.9.3p484 --rubygems 2.0.9

OR

Update

Are you sure that you are using an updated version of RVM?

rvm get head
rvm install 1.9.3

Hope it helps :)

Solution

Do rvm list known . If it does not list the ruby version one is after, one can still install that version from local source. Some ruby versions are not maintained and won't be listed and rvm might generate the wrong URL.

For example installing ruby-1.9.3-p484 goes like this:

First download the ruby archive into RVMs archives folder:

cd ~/.rvm/archives; wget http://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.bz2

Then install with the following flags:

rvm install 1.9.3-p484 --verify-downloads 2 --disable-binary

Explanation

I had to do it like this after not being able to do: rvm install ruby-1.9.3p484

Since the above command generated this error:

The requested url does not exist(22): ' https://cache.ruby-lang.org/pub/ruby/./ruby-1.9.3p484.tar.bz2 ' Checking fallback: https://ftp.ruby-lang.org/pub/ruby/./ruby-1.9.3p484.tar.bz2 No fallback URL could be found, try increasing timeout with:

echo "export rvm_max_time_flag=20" >> ~/.rvmrc

There has been an error fetching the ruby interpreter. Halting the installation.

Also see this SO answer RVM install ruby from local source

Also faced similar issue, rvm install 2.5.x did not work, saw following error:

Installing Ruby from source to: /Users/sdorwat/.rvm/rubies/ruby-2.5.x, this may take a while depending on your cpu(s)... ruby-2.5.x - #downloading ruby-2.5.x, this may take a while depending on your connection... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 404 The requested url does not exist(22): 'https://cache.ruby-lang.org/pub/ruby/./ruby-2.5.x.tar.bz2' Checking fallback: https://ftp.ruby-lang.org/pub/ruby/./ruby-2.5.x.tar.bz2 No fallback URL could be found, try increasing timeout with: . . There has been an error fetching the ruby interpreter. Halting the installation.

Following command worked: rvm install ruby-2.5

I resolve that just changing the mod of the path of rvm

sudo chmod 777 -R /path/to/rvm 

in my case: /usr/local/rvm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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