简体   繁体   English

RVM 安装 Ruby 失败

[英]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.我正在尝试通过 RVM 安装较旧的 Ruby 版本,但安装失败并出现我以前从未见过的错误。 I've already changed the rvm_max_time_flag but it didn't help.我已经更改了rvm_max_time_flag但它没有帮助。 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.它说 URL 不存在或 URL 没有可供下载的 ruby​​ 版本。

Try installing with a compatible ruby-gem version:尝试使用兼容的 ruby​​-gem 版本进行安装:

rvm install 1.9.3p484 --rubygems 2.0.9

OR或者

Update更新

Are you sure that you are using an updated version of RVM?您确定您使用的是 RVM 的更新版本吗?

rvm get head
rvm install 1.9.3

Hope it helps :)希望能帮助到你 :)

Solution解决方案

Do rvm list known .rvm list known If it does not list the ruby version one is after, one can still install that version from local source.如果它没有列出之后的 ruby​​ 版本,仍然可以从本地源安装该版本。 Some ruby versions are not maintained and won't be listed and rvm might generate the wrong URL.一些 ruby​​ 版本没有维护,不会被列出,rvm 可能会生成错误的 URL。

For example installing ruby-1.9.3-p484 goes like this:例如安装ruby-1.9.3-p484是这样的:

First download the ruby archive into RVMs archives folder:首先将 ruby​​ 存档下载到 RVM 的存档文件夹中:

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在无法做到之后我不得不这样做: 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:请求的 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回声“出口rvm_max_time_flag=20”>>~/.rvmrc

There has been an error fetching the ruby interpreter.获取 ruby​​ 解释器时出错。 Halting the installation.停止安装。

Also see this SO answer RVM install ruby from local source另请参阅此 SO 答案RVM install ruby​​ from local source

Also faced similar issue, rvm install 2.5.x did not work, saw following error:也遇到了类似的问题,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: .将 Ruby 从源安装到:/Users/sdorwat/.rvm/rubies/ruby-2.5.x,这可能需要一段时间,具体取决于您的 CPU... ruby​​-2.5.x - #downloading ruby​​-2.5.x ,这可能需要一段时间,具体取决于您的连接... % Total % Received % Xferd 平均速度时间时间当前下载上传总花费左速度 0 0 0 0 0 0 0 0 --:--:-- --: --:-- --:--:-- 0 curl: (22) 请求的 URL 返回错误:404 请求的 url 不存在 (22): 'https://cache.ruby-lang.org/pub /ruby/./ruby-2.5.x.tar.bz2' 检查回退: https ://ftp.ruby-lang.org/pub/ruby/./ruby-2.5.x.tar.bz2 不能有回退 URL找到,尝试增加超时: . . There has been an error fetching the ruby interpreter.获取 ruby​​ 解释器时出错。 Halting the installation.停止安装。

Following command worked: rvm install ruby-2.5以下命令有效: rvm install ruby-2.5

I resolve that just changing the mod of the path of rvm我解决了只需更改rvm路径的mod

sudo chmod 777 -R /path/to/rvm 

in my case: /usr/local/rvm就我而言:/usr/local/rvm

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

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