English 中文(简体)
无法在任何仓库中找到有效的宝石轨( 0) 。
原标题:Could not find a valid gem rails (>= 0) in any repository

我在一个新鲜的mac上,刚刚用rvm安装了1.9.3红宝石。 现在我试图安装栏杆, 并在这个职位的标题上错误。 我从命令线上把信息都贴在下面, 看看是否有人能帮我!

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$ 
问题回答

这里的线索是 WARNING:错误获取数据: SocketError: getdddrinfo: 已提供或未知的 nodename 或 servname (http://rubygems.org/latest_specs4.8.gz)

这表明目前Rubygems. org 上有一个问题。 你那边几乎肯定没有问题。 过一阵子再试一下, 应该没问题。 我刚刚试了一下mac, 结果效果很好。

我用宝石安装的代理指令选项解决这个问题。 它有以下格式:

$ gem install --http-proxy http://201.187.107.19:8080 rails

注意, IP 地址和端口号是指代理文件。 您应该搜索代理文件列表, 并使用其中的一个代理文件 。

网站的缩略语为:http://www.cybersyndrome.net/pla5.html

另外,为了取得成功,我必须尝试7到8个不同的代理人。不要放弃。

注意, 您也可以看到以下错误 :

ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: rails requires activesupport (= 3.2.8), actionpack (= 3.2.8), activerecord (= 3.2.8), activeresource (= 3.2.8), actionmailer (= 3.2.8), railties (= 3.2.8), bundler (~> 1.0)

不要放弃和继续使用名单上的下一个代理人 祝你好运





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签