QA@IT

How to install ruby 1.8.7 with rvm?

3437 PV

When I try to install ruby 1.8.7 with rvm(1.22.15) like rvm install 1.8.7, it showed me:

Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/12.04/x86_64/ruby-1.8.7-p374.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/username/.rvm/rubies/ruby-1.8.7-p374, this may take a while depending on your cpu(s)...
ruby-1.8.7-p374 - #downloading ruby-1.8.7-p374, 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   660    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0   660    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 401
The requested url does not exist(22): 'http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.bz2'
Checking fallback: http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.bz2
Checking fallback: http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.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.

But after I run echo "export rvm_max_time_flag=20" >> ~/.rvmrc,the result was the same.

  • I edited my answer for reply to your comment. -

回答

I try with my ubuntu 12.04 i686 ( sorry, not x86_64 ),

My install process was successed.

$ rvm install 1.8.7
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/12.04/i386/ruby-1.8.7-p374.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Installing required packages: gawk, libreadline6-dev, zlib1g-dev, libssl-dev, libyaml-dev, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, bison, pkg-config, libffi-dev................................
Requirements installation successful.
Installing Ruby from source to: /home/ACCOUNTNAME/.rvm/rubies/ruby-1.8.7-p374, this may take a while depending on your cpu(s)...
ruby-1.8.7-p374 - #downloading ruby-1.8.7-p374, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4150k  100 4150k    0     0   900k      0  0:00:04  0:00:04 --:--:--  968k
ruby-1.8.7-p374 - #extracting ruby-1.8.7-p374 to /home/ACCOUNTNAME/.rvm/src/ruby-1.8.7-p374.

and more logs

And the URL http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.bz2 exists.

In your case, curl returns 401. 401 means unauthorized.
Does your network have proxy server?


If you can get the ruby-1.8.7-p374.tar.bz2 with different method,
locate that file under ~/.rvm/archives.
( ~/.rvm/archives/ruby-1.8.7-p374.tar.bz2 )
and try again
rvm install ruby-1.8.7

Edited 2013/10/18

But why I can install 1.9.3 or 2.0.0 with rvm?

Probably, rvm found the precompiled binaries of those, and install process run under your linux user account. This time, your proxy settings work correctly.

On the other hand, when you install ruby 1.8.7, rvm display log like following :
No binary rubies available for: ubuntu/12.04/i386/ruby-1.8.7-p374.
In that case, rvm compile ruby 1.8.7 from source with sudo privileges. However, user environment variables don't carry over (also proxy settings too).
I think that's why you failed install ruby only 1.8.7.

Bytheway, you can see the list of precompiled binaries in
https://github.com/wayneeseguin/rvm/blob/master/config/remote
or
/usr/local/rvm/config/remote

Thanks for reading my poor English.

編集 履歴 (4)
  • あ、過去の質問見たら日本語が…。日本語でも平気だったのかな。 -
  • Thank you very much!I think it was proxy's trouble.But why I can install 1.9.3 or 2.0.0 with rvm? -
  • Thank you.Your English is not poor,and your answer is so good:) -
ウォッチ

この質問への回答やコメントをメールでお知らせします。