我试图通过RVM安装一个旧的Ruby版本,但安装失败,出现了一个我从未见过的错误。我已经更改了rvm_max_time_flag
,但它没有帮助。我在这里能做什么?
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
它表示URL不存在,或者URL没有可供下载的ruby版本。
尝试安装兼容的ruby gem版本:
rvm install 1.9.3p484 --rubygems 2.0.9
或
更新
你确定你使用的是RVM的更新版本吗?
rvm get head
rvm install 1.9.3
希望有帮助:)
解决方案
执行rvm list known
。如果它没有列出所使用的ruby版本,则仍然可以从本地源安装该版本。有些ruby版本没有维护,也不会列出,rvm可能会生成错误的URL。
例如,安装ruby-1.9.3-p484如下所示:
首先将ruby档案下载到RVMs档案文件夹中:
cd ~/.rvm/archives; wget http://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.bz2
然后使用以下标志进行安装:
rvm install 1.9.3-p484 --verify-downloads 2 --disable-binary
解释
在不能做到以下几点之后,我不得不这样做:rvm install ruby-1.9.3p484
由于上述命令生成了此错误:
请求的url不存在(22):'https://cache.ruby-lang.org/pub/ruby/./ruby-1.9.3p484.tar.bz2'正在检查回退:https://ftp.ruby-lang.org/pub/ruby/./ruby-1.9.3p484.tar.bz2找不到回退URL,请尝试使用增加超时
echo"export rvm_max_time_flag=20">>~/.rvmrc
获取ruby解释器时出错。停止安装。
另请参阅此SO应答RVM从本地源安装ruby
也面临类似的问题,rvm install 2.5.x
不起作用,
看到以下错误:
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.
以下命令有效:rvm install ruby-2.5
我解决了只需更改rvm 路径的模式
sudo chmod 777 -R /path/to/rvm
在我的情况下:/usr/local/rvm