Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

ruby - Could not find a valid gem 'rails' (>= 0) in any repository

I'm on a fresh mac and just installed ruby 1.9.3 using rvm. Now I'm trying to install rails and getting the error on the title of this post. I'll post below all info I have from the command line to see if anyone can help me out here!!

Leonardos-MacBook-Air:~ leo$ gem install rails
WARNING:  Error fetching data: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://rubygems.org/latest_specs.4.8.gz)
ERROR:  Could not find a valid gem 'rails' (>= 0) in any repository
ERROR:  Possible alternatives: rails
Leonardos-MacBook-Air:~ leo$ ping rubygems.org
PING rubygems.org (204.232.149.25): 56 data bytes
64 bytes from 204.232.149.25: icmp_seq=0 ttl=47 time=104.399 ms
64 bytes from 204.232.149.25: icmp_seq=1 ttl=47 time=105.760 ms
^C
--- rubygems.org ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 104.399/105.079/105.760/0.681 ms
Leonardos-MacBook-Air:~ leo$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin11.4.0]
  - INSTALLATION DIRECTORY: /Users/leo/.rvm/gems/ruby-1.9.3-p194
  - RUBY EXECUTABLE: /Users/leo/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/leo/.rvm/gems/ruby-1.9.3-p194/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/leo/.rvm/gems/ruby-1.9.3-p194
     - /Users/leo/.rvm/gems/ruby-1.9.3-p194@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
Leonardos-MacBook-Air:~ leo$ ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
Leonardos-MacBook-Air:~ leo$ 
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The clue here is WARNING: Error fetching data: SocketError: getaddrinfo: nodename nor servname provided, or not known (http://rubygems.org/latest_specs.4.8.gz)

This indicates there's an issue at Rubygems.org at the moment. There's almost certainly nothing wrong on your end. Try again in a little while and it should be ok. I just tried myself on a mac and it worked fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...