rbenv安装ruby校验和不匹配osx [英] rbenv installing ruby checksum mismatch osx

查看:237
本文介绍了rbenv安装ruby校验和不匹配osx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功安装rbenv和ruby build山狮。
运行 rbenv install 1.9.3-p392

I have successfully installed rbenv and ruby build on mountain lion. Running rbenv install 1.9.3-p392 ends with:


校验和不匹配:ruby-1.9.3-p392.tar.gz(文件已损坏)
预期f689a7b61379f83cbbed3c7077d83859,得到1cfc2ff433dbe80f8ff1a9dba2fd5636

它下载的文件似乎很好,如果我使用curl手动下载文件,我会得到相同的不正确的校验和。

The file that it is downloading seems fine, and if I download the file manually using curl, I get the same incorrect checksum.

有任何人遇到这个吗?他们是如何解决的?

Has anybody encountered this before? How did they resolve it?

推荐答案

tl:dr;使用浏览器从下载ruby:http://ftp.ruby -lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz ,并将它放在〜/ .rbenv / caches / ruby​​-1.9.3-p392中.tar.gz ,然后运行 rbenv install 1.9.3-p392

tl:dr; Download the ruby using your browser from http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz and place it in ~/.rbenv/caches/ruby-1.9.3-p392.tar.gz, then run rbenv install 1.9.3-p392

问题在于 curl ftp.ruby-lang.org 服务器。因为curl不通过 Accept-Encoding:gzip ,所以服务器提供了非gzip版本的ruby(〜60mb)而不是压缩版本(〜12mb)。

The problem lies with curl, and the ftp.ruby-lang.org server. Because curl does not pass through Accept-Encoding: gzip, the server delivers the non-gzipped version of the ruby (~60mb) instead of the compressed version (~12mb). This causes the checksum to fail, and the build to stop.

使用curl --headerAccept-Encoding:gzip下载文件,可以提供正确的校验和。但是,最新版本的rbenv将-q标志传递给curl,它忽略了.curlrc文件,这使得在不编辑源代码的情况下很难配置。

Downloading the file with curl --header "Accept-Encoding: gzip", gives the correct checksum. However, the latest version of rbenv passes the -q flag to curl, which ignores .curlrc files, making this hard to configure without editing the source.

手动下载ruby.tar.gz并将其放在缓存文件夹中,完全跳过问题。

The easy solution is to download the ruby.tar.gz manually and place it in the cache folder, skipping the issue entirely.

这篇关于rbenv安装ruby校验和不匹配osx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆