公告 Ruby China 的 RubyGems 镜像上线

huacnlee for Ruby China · 2016年03月09日 · 最后由 huopo125 回复于 2016年05月12日 · 64779 次阅读

几年前,由我起头,我们搭建了 ruby.taobao.org 为国内开发者解决 Gem 安装的问题,现在应该国内绝大多数,甚至所有(国内服务器,国内网络)的 Ruby 开发者企业,应该都在用它。

但最近越来越发现之前 ruby.taobao.org 很难同步了,原因有很多,之前的实现方式过于复杂,服务器在国内,同步困难,阿里的网络安全要求维护服务器得是公司员工.... 各种限制导致我们在维护的时候困难重重,尤其是当 @fsword @qhwa 离职以后,根本无法再继续维护了。

为了有一个可持续发展未来,我们考虑由 Ruby China 来负责这个事情,这样可以像现在 Ruby China 社区,RubyConf China 一样,由社区的很多参与者来共同维护。

这件事情我们已经考虑了一年了,之前一直没有找到一个好的方式来解决,以及一些其他因素,比如资金的问题。


这周,我们终于找到了解决方案,也找到了赞助商:

https://www.qcloud.com

腾讯云慷慨的给我们赞助了第一期 30000 元用于服务器以及 CDN 的开销。

整个 gems.ruby-china.org 的架构:

2016-05-18 Updated: Gems 存储放到了 UpYun 上面,通过 UpYun 的 CDN 来解决,同时配合 UpYun 的镜像存储功能,减少回源到国外的次数。 过程:https://ruby-china.org/topics/29978

                              [gems.ruby-china.org] [cdn.gems.ruby-china.org]
                                                   |
                                   {Load Balance us.gems.ruby-china.org}
                                                   |
                                 [us0.gems.ruby-china.org]  ... us1 .. us2
                                                   |
                                                [Nginx]
                                                   |
              ---------------------------------------------------------------------------------------
              |                                    |                          |                     |
  {*.4.8, *.4.8.gz}                          {/gems, /quick}                 {/}                 {/api}
             |                                     |                          |                     |
[rubygems.global.ssl.fastly.net]      <gems-ruby-china.b0.upaiyun.com>   [app server]         [rubygems.org]
                                                   |
                                              [UpYun CDN]
                                                   |
                                         ----------------------
                                         Found             Not Found
                                          |                   |
                                        [200]       [rubygems.global.ssl.fastly.net]
                                                              |
                                                            [200] ------------> [UpYun Mirror Store]

新的方案的特点

  • 实时的,不再有同步耗时的问题;
  • 全球 400+ CDN 节点(据腾讯官方所说 ~~)为 Gem 下载加速;
  • 更加简单有效的架构,稳定性更高;
  • 背后有两台国外服务器,确保稳定性,确保 CDN 汇源能获取到数据;

使用方式

https://gems.ruby-china.org/

在那边的页面有介绍了,和之前 ruby.taobao.org 的方式也是一样的。

项目源代码

https://github.com/ruby-china/rubygems-mirror

关于 SSL

我们稍后会跟进,目前腾讯云 CDN 上面上传 SSL 证书信息在我这里有点问题。 SSL 已上线!

沙发一个先

#1 楼 @alsotang 感谢腾讯云支持,感谢你帮忙连线!

楼主 说的时时怎么实现的啊,没看明白。

#3 楼 @alsotang 三年前的时候的事情,当时很想贡献一点自己的力量。

#4 楼 @zming619 就是那个架构图 后面 Nginx,配置在我公布出来的开源项目里面。

这个要支持,之前一直用的 ruby.taobao.org。

感觉 ruby-china 声望要更上一层楼

#6 楼 @huacnlee 支持支持!也没看懂,是指通过 nginx 来转发请求吗?主要是靠 CDN 吧?之前 ruby.taobao.org 的实现是同步一份数据到本地的吗?

hostname "gems.ruby-china.org" does not match the server certificate (https://gems.ruby-china.org/specs.4.8.gz)

出现问题

me too

➜  test git:(master) ✗ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
Error fetching https://gems.ruby-china.org/:
    hostname "gems.ruby-china.org" does not match the server certificate (https://gems.ruby-china.org/specs.4.8.gz)

#10 楼 @nil #11 楼 @jay_li

https 功能再等待一下

好东西,支持一下

这个必须支持一下 一直用 ruby.taobao.org 偶尔会有不稳定的情况 尤其用国外的 ci 服务 比较慢 如果有国外的 cdn 就好多了 支持一下!!!

唉 当时是看着 ruby-china 成长起来的 然后学的 mongodb 现在 ruby-china 不用 mongodb 了。。我的项目好多地方想参考下都没的参考了 这个还是有点遗憾

顶一个

非常支持 不知道什么时候可以弃用 ruby.taobao.org

以前对 Gem 开发者来说最苦恼的事是发布了一个新版本需要等很久才能用

现在不用等啦 立刻就能下载到最新的版本

棒棒哒~

👍 腾讯云的 CDN 还能加速国外的资源?

伟大的工作!

偶尔 会有 HTTPError

Fetching gem metadata from http://gems.ruby-china.org/..Retrying dependency api due to error (2/4): Bundler::HTTPError Network error while fetching http://gems.ruby-china.org/api/v1/dependencies?gems=actionpack%2Crailties%2Csass%2Csprockets%2Ctilt%2Csprockets-rails%2Cthor%2Crails-dom-testing%2Cautoprefixer-rails%2Cjson%2Crdoc%2Csanitize%2Cactivesupport%2Crake%2Cactiverecord%2Crack%2Cactivemodel%2Cbinding_of_caller%2Cdebug_inspector%2Cminitest%2Ci18n%2Cculerity%2Cnokogiri%2Crack-test%2Cmime-types%2Ccelerity%2Cxpath%2Caddressable%2Cconfiguration%2Cspoon%2Cffi%2Crails_serve_static_assets%2Crails_stdout_logging%2Cactionmailer%2Cactiveresource%2Cactionwebservice%2Cbundler%2Cactionview%2Cactivejob%2Cactioncable%2Ctherubyracer%2Cexecjs%2Cmulti_json%2Ccoffee-script%2Cturbolinks-source%2Cblankslate%2Chaml%2Chtml2haml%2Choe%2Csubexec
Retrying dependency api due to error (3/4): Bundler::HTTPError Network error while fetching http://gems.ruby-china.org/api/v1/dependencies?gems=actionpack%2Crailties%2Csass%2Csprockets%2Ctilt%2Csprockets-rails%2Cthor%2Crails-dom-testing%2Cautoprefixer-rails%2Cjson%2Crdoc%2Csanitize%2Cactivesupport%2Crake%2Cactiverecord%2Crack%2Cactivemodel%2Cbinding_of_caller%2Cdebug_inspector%2Cminitest%2Ci18n%2Cculerity%2Cnokogiri%2Crack-test%2Cmime-types%2Ccelerity%2Cxpath%2Caddressable%2Cconfiguration%2Cspoon%2Cffi%2Crails_serve_static_assets%2Crails_stdout_logging%2Cactionmailer%2Cactiveresource%2Cactionwebservice%2Cbundler%2Cactionview%2Cactivejob%2Cactioncable%2Ctherubyracer%2Cexecjs%2Cmulti_json%2Ccoffee-script%2Cturbolinks-source%2Cblankslate%2Chaml%2Chtml2haml%2Choe%2Csubexec

支持老大!有啥可以帮助支持的可以说出来。

打算大概先自己测试一下看看坑,然后把 Discourse 的淘宝源改到 Ruby China 源。

太赞了。

哇塞,大事件啊

PS 我们能小额赞助么

社区强大!!!!!!!

强烈顶!

顶!d=====( ̄▽ ̄*)b

https 功能上线了!

/api 这里会是问题,直接代理到官方,会有很大概率失败。 不过我现在暂时还抽不出时间贡献,昨天下班时间是凌晨 5 点 .. 不过过阵子应该会好一些。

#43 楼 @qhwa 境外网络连接的失败率没那么高的吧

👍👍👍👍

酷炫!!!造福人类

好顶赞ε=ε=ε=(~ ̄▽ ̄)~

等有 Ruby 鏡像了以後,可以更新一下這頁:https://www.ruby-lang.org/en/downloads/mirrors

#52 楼 @juanito 现在还没有那个

必需要赞:plus1:

必须要赞一下!

必须得赞!!终于做了这件事了

添加源遇到问题 Error fetching https://gems.ruby-china.org/: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://gems.ru by-china.org/specs.4.8.gz)

那原来的 taobao 的那个,还用吗?

先自己测试一下看看,然后把 的淘宝源改到 Ruby China 源。

感谢我大腾讯啊

能不能加速 npm

大赞:plus1:

新架构是完全做代理么?我也怀疑 api 的压力是主站不能承担的

另外,@qhwa 是如彼还是墨泪?没想到也离职了

现在 gem 包都安装不上,提示如下:大家有这种情况吗? $ bundle install Fetching gem metadata from https://ruby.taobao.org/........... Fetching version metadata from https://ruby.taobao.org/.. Resolving dependencies............. Using rake 10.5.0 Using i18n 0.7.0 Using json 1.8.3

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/gems/minitest-5.8.4.gem) Using thread_safe 0.3.5

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/gems/builder-3.2.2.gem)

$ bundle install Fetching gem metadata from https://rubygems.org/........... Fetching version metadata from https://rubygems.org/... Fetching dependency metadata from https://rubygems.org/.. Resolving dependencies............

Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) for "rubygems.org" port 443 (https://rubygems.org/gems/rake-11.1.0.gem)

支持一个,腾讯在 3q 大战后,慢慢变成一个让人尊敬的企业。

#66 楼 @xiaohuacc 有这种情况……为什么啊?

非常感谢,这样做 rails 更方便了

#66 楼 @xiaohuacc 你的 source 没有换过来吗?怎么还是用的 https://ruby.taobao.org/

好东西,支持一下

:(昨天我也遇到 Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/gems/minitest-5.8.4.gem) Using thread_safe 0.3.5

这个错误,估计是淘宝镜像的问题。这个好消息来的真是及时啊。哎,天朝程序猿也真 TM 命苦

貌似也有点问题啊。 Error fetching https://gems.ruby-china.org/: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: ce rtificate verify failed (https://gems.ruby-china.org/specs.4.8.gz) 是不是还在调试中?

大赞,可以增加社区赞助等方式,募资来维持网络贷款等消耗。

#6 楼 @huacnlee 大神,厚着脸皮来求你帮帮忙,实在没办法了。https://ruby-china.org/topics/29323#reply10

#74 楼 @hitnoah 谢谢,晚上回去试一下:)

time curl -I https://gems.ruby-china.org/specs.4.8.gz
HTTP/1.1 200 OK
Server: nnws/1.7.3.6
Date: Mon, 14 Mar 2016 06:11:12 GMT
Content-Type: application/octet-stream
Content-Length: 2754937
Connection: keep-alive
Last-Modified: Mon, 14 Mar 2016 06:08:39 GMT
x-amz-id-2: zSQTtBiea/D+bYUaEysB5dDLwQUnTORjMXrxEXCN0xAK1a7NMcVblH4GxyrK8PV5aOHvnzNxJIM=
x-amz-request-id: BEDBC03AC1B4C130
x-amz-replication-status: PENDING
x-amz-version-id: tYMQMF7kPdAW0JEIUDEisJxc9z7XHPqU
x-amz-meta-surrogate-key: full-index
ETag: "fba8e2bffb56ce7579af4dbf7d526bea"
Via: 1.1 varnish
Fastly-Debug-Digest: 0debb0ceabb31d16abb864478a5071786f8f67d8d7863ea1fe1be712493ee2ac
Accept-Ranges: bytes
Via: 1.1 varnish
Age: 94
X-Served-By: cache-sea1922-SEA, cache-ord1731-ORD
X-Cache: HIT, HIT
X-Cache-Hits: 5, 1
X-Daa-Tunnel: hop_count=1
X-Cache-Lookup: Hit From Upstream

curl -I https://gems.ruby-china.org/specs.4.8.gz  0.04s user 0.02s system 0% cpu 54.597 total

腾讯云的云硬盘略坑啊,居然没有默认挂载上,需要手动执行:

$ sudo su root
$ if grep -q /data /etc/fstab ; then uuid=notneed; echo /data already in fstab; else uuid=`mkfs.ext3 /dev/vdb > /dev/null 2>&1 && blkid /dev/vdb | awk '{print $2}'`;fi;if [[ $uuid == UUID* ]]; then echo $uuid /data ext3 noatime,acl,user_xattr 1 0 >> /etc/fstab; mount -a; else echo mkfs failed; fi;

aws 的硬盘也是默认不挂载的

赞,什么时候部署 RVM 镜像源!

使用这个 source 之后 gem update ---system 不可以执行


~/.middleman:$ gem install middleman -V
HEAD https://ruby.taobao.org/api/v1/dependencies
200 OK
GET https://ruby.taobao.org/api/v1/dependencies?gems=middleman
200 OK
GET https://ruby.taobao.org/quick/Marshal.4.8/middleman-4.1.2.gemspec.rz
302 Moved Temporarily
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/quick/Marshal.4.8/middleman-4.1.2.gemspec.rz)

86 楼 已删除

已经使用几天,相当不稳定,经常遇到错误,几乎没有一次 bundle install 能一次成功。

Fetching gem metadata from https://gems.ruby-china.org/..Retrying dependency api due to error (2/4): Bundler::HTTPError Network error while fetching https://gems.ruby-china.org/api/v1/dependencies?gems=spoon%2Ccucumber%2Ccolorize%2Ccolored%2Ciobuffer%2Clockfile%2Cbones%2Caddresasble%2Ctinder%2Cstrptime%2Cprogressbar%2Crspec-instafail%2Cchalofa_ruby-progressbar%2Crb-fchange%2Crb-kqueue%2Ccelluloid%2Ccelluloid-io%2Cspicycode-rcov%2Csyntax%2Cgrowl%2Clibnotify%2Csys-uname%2Copen_gem%2Cwin32console%2Chttp-cookie%2Cflexmock%2Clivescript-source%2Csfl%2Cfaye-websocket%2Cbackports%2Castrolabe%2Chpricot%2Chtmlentities%2Cechoe%2Cjeweler%2Cruby-debug19%2Cbourne%2Cwebrat%2Crspec-collection_matchers%2Credis-namespace%2Ccompass%2Csprockets-sass%2Clibwebsocket%2Cshotgun%2Ctherubyracer%2Caaronh-chronic%2Crest_client
Retrying dependency api due to error (3/4): Bundler::HTTPError Net::HTTPBadGateway: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nnws/1.7.3.6</center>
</body>
</html>
Retrying dependency api due to error (4/4): Bundler::HTTPError Net::HTTPBadGateway: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nnws/1.7.3.6</center>
</body>
</html>
Gem::RemoteFetcher::FetchError: bad response Bad Gateway 502 (https://gems.ruby-china.org/gems/actionpack-xml_parser-1.0.2.gem)
Bundler::GemspecError: Could not read gem at /home/vanitas/.gem/ruby/2.3/cache/haml-4.0.7.gem. It may be corrupted.

#85 楼 @geekontheway 为什么后面请求的是淘宝的 API 呢?


回源的时候的延迟,gem 一多特别容易让 bundle 中断,部署的时候带上 --retry 加上应该会好一些。 阿里云部署 Discourse 的时候大概因此中断了 3 - 4 次,但是问题很奇怪,有的时候是 gem 下载问题(看起来像回源失败),但是之后再执行 gem update bundler 也因为下不到 spec4.8 失败了(这肯定就不是回源的问题了)。倒是 DigitalOcean 都只中断了 1 次,谜一般...😓

因为不断失败,所以开始走查问题。以下尝试来自于阿里云上海的 139.196.41.197(ipip.net)机器按照 https://gems.ruby-china.org 这个 URL 部署 Discourse 碰到的错误(生产环境部署)。

例子:

第 2 次重试失败(FetcherError 和 GemspecError,应该是 CDN 回源的问题):

Bundler::GemspecError: Could not read gem at /var/www/discourse/vendor/bundle/ruby/2.0.0/cache/redis-3.2.1.gem. It may be corrupted.
Bundler::GemspecError: Could not read gem at /var/www/discourse/vendor/bundle/ruby/2.0.0/cache/msgpack-0.5.11.gem. It may be corrupted.
Gem::RemoteFetcher::FetchError: bad response Bad Gateway 502 (https://gems.ruby-china.org/gems/rb-fsevent-0.9.4.gem)

第 3 次重试失败(API 失败,SSL 签名错误;但是之前的 24 次请求没有问题):

could not fetch from the dependency API, trying the full index
HTTP GET https://gems.ruby-china.org/quick/Marshal.4.8/actionmailer-4.1.10.gemspec.rz
Could not verify the SSL certificate for
https://gems.ruby-china.org/quick/Marshal.4.8/actionmailer-4.1.10.gemspec.rz.

第 4、5 次重试失败:

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    server did not return a valid file (https://gems.ruby-china.org/specs.4.8.gz
    bad response Bad Gateway 502 (https://gems.ruby-china.org/specs.4.8.gz)

既然不是回源问题,那么重新回到 CA 证书这个点上。按照 issues 给的链接从 https://curl.haxx.se/ca/cacert.pem 导入证书链,再指定环境变量。(缺点显而易见,公钥的 integrity 没有保障。不过这是目前的一个让源能用起来的 hack)

然而重新回到了 4、5 次重试的时候失败的问题。虽然仍然不排除阿里云的链接问题。但结合其他人碰到的问题回到镜像的部署问题,还是应该探索下解决的办法,故已提交 issue

http 的环境下 bundle 是成功的,不过 Discourse 相关 gem 花了 18 分钟。

#88 楼 @fantasticfears 谢谢这么详细的记录 明天我找一台试试您的场景 看起来有可能是反向代理的超时问题

经常会有这样的错误 改成 http://协议的地址不回出现。

Fetching additional metadata from https://gems.ruby-china.org/.Retrying dependency api due to error (2/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.ruby-china.org/api/v1/dependencies?gems=celluloid-gems,faraday-middleware.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying dependency api due to error (3/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://gems.ruby-china.org/api/v1/dependencies?gems=celluloid-gems,faraday-middleware.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.

谢谢 ruby china 管理员们对国内 ruby 圈做的努力。

gem sources -a https://gems.ruby-china.org/ Error fetching https://gems.ruby-china.org/: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: ce rtificate verify failed (https://gems.ruby-china.org/specs.4.8.gz)

为啥这个源也是不行呢

感谢,已经将淘宝源改为 ruby China 源了

#93 楼 @huacnlee 貌似服务器是不是有问题,请求超时了

☁  ~  http head https://gems.ruby-china.org/specs.4.8.gz

http: error: Request timed out (30s).
I, [2016-03-16T12:38:09.627165 #37]  INFO -- : > gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
I, [2016-03-16T12:39:38.621329 #37]  INFO -- : Error fetching https://gems.ruby-china.org/:
    server did not return a valid file (https://gems.ruby-china.org/specs.4.8.gz)

I, [2016-03-16T12:39:38.622425 #37]  INFO -- : Terminating async processes
I, [2016-03-16T12:39:38.622530 #37]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid: 66
I, [2016-03-16T12:39:38.622655 #37]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 194
2016-03-16 12:39:38 UTC [66-2] LOG:  received fast shutdown request
2016-03-16 12:39:38 UTC [66-3] LOG:  aborting any active transactions
2016-03-16 12:39:38 UTC [73-2] LOG:  autovacuum launcher shutting down
2016-03-16 12:39:38 UTC [70-1] LOG:  shutting down
194:signal-handler (1458131978) Received SIGTERM scheduling shutdown...
194:M 16 Mar 12:39:38.652 # User requested shutdown...
194:M 16 Mar 12:39:38.653 * Saving the final RDB snapshot before exiting.
2016-03-16 12:39:38 UTC [70-2] LOG:  database system is shut down
194:M 16 Mar 12:39:38.710 * DB saved on disk
194:M 16 Mar 12:39:38.710 # Redis is now ready to exit, bye bye...


FAILED
--------------------
RuntimeError: gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/ failed with return #<Process::Status: pid 287 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cmd"=>["gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/"]}
4d3a9a5937702a71e03afd53cf92ca6870fe1ddfb48c225852659f158375a719
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

反馈问题 gem sources --add https://gems.ruby-china.org/ 卡住了

这种事情还是忙悲哀的,国家不提供资源帮助开发者就算了,还千方百计设置障碍。。。

非常支持!

速度很不错!

非常感谢!

很好很强大

感觉比 taobao 源稍微慢了点点

执行 sudo gem install rails ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/rackup

赞!!!

挺好滴,已经用上了呢

@huacnlee 好像有点慢? 机房在北京

$ ping gems.ruby-china.org
PING 12f7b4-0.ca.1251971244.clb.myqcloud.com (45.113.69.41) 56(84) bytes of data.
64 bytes from 45.113.69.41: icmp_seq=1 ttl=49 time=233 ms
64 bytes from 45.113.69.41: icmp_seq=2 ttl=49 time=230 ms
64 bytes from 45.113.69.41: icmp_seq=3 ttl=49 time=231 ms
64 bytes from 45.113.69.41: icmp_seq=4 ttl=49 time=231 ms
64 bytes from 45.113.69.41: icmp_seq=5 ttl=49 time=232 ms
64 bytes from 45.113.69.41: icmp_seq=6 ttl=49 time=227 ms
64 bytes from 45.113.69.41: icmp_seq=7 ttl=49 time=234 ms
64 bytes from 45.113.69.41: icmp_seq=8 ttl=49 time=233 ms
64 bytes from 45.113.69.41: icmp_seq=9 ttl=49 time=229 ms
64 bytes from 45.113.69.41: icmp_seq=10 ttl=49 time=230 ms
^C
--- 12f7b4-0.ca.1251971244.clb.myqcloud.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9003ms
rtt min/avg/max/mdev = 227.386/231.563/234.802/2.112 ms

对比之前的 taobao 源

$ ping ruby.taobao.org
PING ruby.taobao.org (223.6.253.37) 56(84) bytes of data.
64 bytes from 223.6.253.37: icmp_seq=1 ttl=41 time=34.8 ms
64 bytes from 223.6.253.37: icmp_seq=2 ttl=41 time=34.9 ms
64 bytes from 223.6.253.37: icmp_seq=3 ttl=41 time=34.9 ms
64 bytes from 223.6.253.37: icmp_seq=4 ttl=41 time=35.0 ms
64 bytes from 223.6.253.37: icmp_seq=5 ttl=41 time=35.0 ms
64 bytes from 223.6.253.37: icmp_seq=6 ttl=41 time=34.9 ms
64 bytes from 223.6.253.37: icmp_seq=7 ttl=41 time=34.9 ms
64 bytes from 223.6.253.37: icmp_seq=8 ttl=41 time=34.9 ms
64 bytes from 223.6.253.37: icmp_seq=9 ttl=41 time=35.0 ms
64 bytes from 223.6.253.37: icmp_seq=10 ttl=41 time=35.0 ms
^C
--- ruby.taobao.org ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9010ms
rtt min/avg/max/mdev = 34.866/34.977/35.086/0.229 ms

#111 楼 @tony612 当然了,国外服务器呀

已经用上,赞

谢谢。

@huacnlee 也就是说 ruby.taobao.org 放弃维护了对吗?

支持 Rails 5.0.0.beta3 吗?阿里云的镜像就不支持,从国内 VPS 上访问官方源那叫一个慢……

太棒了,支持。

对这种造福国内程序猿的行为,值得大力支持和宣传。给你 255 个赞!

在 腾讯云上 使用,bundle install 时好多 timeout

Gem::RemoteFetcher::UnknownHostError: timed out (https://gems.ruby-china.org/gems/net-ssh-3.1.1.gem) Gem::RemoteFetcher::UnknownHostError: timed out (https://gems.ruby-china.org/gems/cocoon-1.2.9.gem)

好像现在挂了(2016 年 03 月 25 日 14:56:57 北京联通)

#59 楼 @hitnoah 我今天也遇到这个问题,不知道你的解决了没有?怎么解决的?

windows 下报 certificate verify failed 错误是 ssl 证书的问题,这里有解决办法。 https://gist.github.com/fnichol/867550 http://blog.163.com/sdhhqb@126/blog/static/637055372016230923537/

希望有一天我们不用这样也可以直接用官方的源

支持!

#122 楼 @jun1st 我也遇到过,试试修改 DNS 服务器 (/etc/resolv.conf) 为公网 DNS。 腾讯云服务器上默认使用的是局域网 DNS 服务器,而这个源的服务器也是腾讯云,导致某些域名会被解析为局域网 IP,有些局域网 IP ping 不通,因而失败。 也并不是一直都会失败。 希望官方解决一下。

#130 楼 @bianjp X,太感谢了,改成 114 的就好了

找了腾讯的客服,完全没有用。。。

#131 楼 @jun1st @huacnlee 希望与腾讯云协商解决一下。

CDN 是不是有问题?经常连接超时。

Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Operation timed out - SSL_connect (https://gems.ruby-china.org/gems/fog-vmfusion-0.1.0.gem)
Installing fog-atmos 0.1.0
Installing fog-ecloud 0.3.0
Installing fog-profitbricks 0.0.3
Installing fog-terremark 0.1.0
Installing fog-voxel 0.1.0
Installing fog-aws 0.1.1
Installing fog-brightbox 0.8.0
Installing fog-radosgw 0.0.4
Installing fog-sakuracloud 1.0.1
Installing fog-serverlove 0.1.2
Installing fog-softlayer 0.4.7

Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Operation timed out - SSL_connect (https://gems.ruby-china.org/gems/fog-storm_on_demand-0.1.1.gem)
An error occurred while installing fog-vmfusion (0.1.0), and Bundler cannot continue.
Make sure that `gem install fog-vmfusion -v '0.1.0'` succeeds before bundling.

dig 了下,貌似解析回来的是个加拿大的 IP 地址:

 ~ dig @114.114.114.114 gems.ruby-china.org

; <<>> DiG 9.10.3-P4 <<>> @114.114.114.114 gems.ruby-china.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53557
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;gems.ruby-china.org.       IN  A

;; ANSWER SECTION:
gems.ruby-china.org.    553 IN  CNAME   12f7b4-0.ca.1251971244.clb.myqcloud.com.
12f7b4-0.ca.1251971244.clb.myqcloud.com. 553 IN A 45.113.69.41

;; Query time: 51 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: Wed Apr 06 11:05:44 CST 2016
;; MSG SIZE  rcvd: 106
gem sources --add https://gems.ruby-china.org/ --remove https://
rubygems.org/
Error fetching https://gems.ruby-china.org/:
        SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: ce
rtificate verify failed (https://gems.ruby-china.org/specs.4.8.gz)

感觉很卡,偶尔还会出现安装问题。例如 Error installing concurrent-ruby: invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/ok/.rvm/gems/ruby-2.2.3@rails426/cache/concurrent-ruby-1.0.2.gem

#124 楼 @qq83387856 更新一下证书 rvm osx-ssl-certs update all (mac),其它的参考 https://rvm.io/support/fixing-broken-ssl-certificates

请问<center>nnws/1.7.3.6</center>中的 nnws 是 nginx 的变种吗,还是只是修改一下名字

需要 登录 后方可回复, 如果你还没有账号请 注册新账号