环境:
os x 10.10.3
ruby 版本:通过rbenv 安装的2.1.6
source: https://ruby.taobao.org/
➜ metasploit-framework git:(master) ruby -v
ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-darwin14.0]
➜ metasploit-framework git:(master) rbenv which gem
/Users/chu/.rbenv/versions/2.1.6/bin/gem
➜ metasploit-framework git:(master) gem install bundler
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://ruby.taobao.org/ - no such name (https://ruby.taobao.org/latest_specs.4.8.gz)
但是疑惑的是,本级还装了2.2.2版本的ruby,它就可以进行安装,默认自带的也可以,只有2.1.6 不可以,求解决。
1
chuhades OP 报错是 no such name,感觉很疑惑,附相信错误信息:
➜ metasploit-framework git:(master) gem install bundler --debug Exception `LoadError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/resolv.rb:169 - LoadError Exception `Resolv::DNS::Config::NXDomain' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/resolv.rb:547 - _rubygems._tcp.ruby.taobao.org Exception `Resolv::DNS::Config::NXDomain' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/resolv.rb:547 - _rubygems._tcp.ruby.taobao.org.local Exception `Resolv::ResolvError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/resolv.rb:492 - DNS result has no information for _rubygems._tcp.ruby.taobao.org Exception `Errno::EEXIST' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/fileutils.rb:250 - File exists @ dir_s_mkdir - /Users/chu/.gem/specs/ruby.taobao.org%443 Exception `SocketError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/net/http.rb:879 - getaddrinfo: Invalid value for ai_flags Exception `Gem::RemoteFetcher::UnknownHostError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/remote_fetcher.rb:283 - no such name (https://ruby.taobao.org/latest_specs.4.8.gz) Exception `Gem::RemoteFetcher::UnknownHostError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/spec_fetcher.rb:268 - no such name (https://ruby.taobao.org/latest_specs.4.8.gz) Exception `Gem::SpecificGemNotFoundException' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/dependency_installer.rb:297 - Could not find a valid gem 'bundler' (>= 0) locally or in a repository ERROR: Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://ruby.taobao.org/ - no such name (https://ruby.taobao.org/latest_specs.4.8.gz) Exception `Errno::EEXIST' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/fileutils.rb:250 - File exists @ dir_s_mkdir - /Users/chu/.gem/specs/ruby.taobao.org%443 Exception `SocketError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/net/http.rb:879 - getaddrinfo: Invalid value for ai_flags Exception `Gem::RemoteFetcher::UnknownHostError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/remote_fetcher.rb:283 - no such name (https://ruby.taobao.org/prerelease_specs.4.8.gz) Exception `Errno::EEXIST' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/fileutils.rb:250 - File exists @ dir_s_mkdir - /Users/chu/.gem/specs/ruby.taobao.org%443 Exception `SocketError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/net/http.rb:879 - getaddrinfo: Invalid value for ai_flags Exception `Gem::RemoteFetcher::UnknownHostError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/remote_fetcher.rb:283 - no such name (https://ruby.taobao.org/specs.4.8.gz) Exception `Gem::RemoteFetcher::UnknownHostError' at /Users/chu/.rbenv/versions/2.1.6/lib/ruby/2.1.0/rubygems/spec_fetcher.rb:268 - no such name (https://ruby.taobao.org/specs.4.8.gz) |
2
046569 2015-05-22 03:07:35 +08:00
怀疑 DNS 故障,考虑换个 DNS 或者开梯子试试?
|
4
046569 2015-05-22 03:16:12 +08:00
@chuhades
你那两个 DNS 有可能被运营商污染了(如果你没使用加密, Google 的一定被污染).开梯子排查最节省时间.梯子速度快的话,官方源比淘宝源还快... |
5
046569 2015-05-22 03:28:57 +08:00 1
|
7
liprais 2015-05-22 09:00:17 +08:00 via iPhone
https => http 试试?
|
8
halczy 2015-05-22 09:48:25 +08:00
需要全局代理才行, RubyGems的服务器被污染了.
|
9
chuhades OP 把项目删除,重新clone了下,然后重装了ruby,就可以了,不知道为什么。
感谢楼上各位~ |
10
FrankFang128 2016-11-21 17:08:52 +08:00
我也遇到了, rbenv 的 ruby 报错,系统自带的就不报错。
|