3

我尝试使用 ruby​​ ruby​​-2.0.0-p247 在 rails 4.00 中创建一个 rails 应用程序。在捆绑安装过程中,它显示一个错误:initialize: No such file or directory. 下面是错误的输出

 run  bundle install
 /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `initialize': No such file or directory - getaddrinfo (Errno::ENOENT)
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `open'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:877:in `connect'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1449:in `begin_transport'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1402:in `transport_request'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1376:in `request'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/net/http/persistent.rb:935:in `request'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:202:in `fetch'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:242:in `fetch_dependency_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:151:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:154:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:154:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:154:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:106:in `specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `block in remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `each'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:163:in `fetch_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:67:in `specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:192:in `block (2 levels) in index'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `each'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `block in index'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/index.rb:9:in `build'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:185:in `index'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/bin/bundle:20:in `block in <main>'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/bin/bundle:20:in `<main>'

 Fetching gem metadata from https://rubygems.org/....Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!

我应该怎么做才能解决这个问题?

4

2 回答 2

4

我刚刚遇到了类似的问题,几天后重新安装了 rvm(头疼)后它又回来了。这次我尝试使用注释来隔离我的 Gemfile 中的哪些 gem 导致了问题。我注意到这是新的宝石。然后我试着简单地

gem install <problem_gem>

ERROR:  Could not find a valid gem 'problem_gem' (>= 0), here is why:
      Unable to download data from https://rubygems.org/ - no such name      (https://rubygems.org/latest_specs.4.8.gz)

这让我觉得我没有连接到互联网。一旦我再次连接。

捆绑工作!

bundle install
于 2014-02-21T16:18:43.510 回答
0

清理并重新安装新的 RVM,然后重试..

按照此链接安装新的 RVM:

https://rvm.io/rvm/install

我遇到了类似的问题,我安装了 RVM 的当前稳定版本 rvm 1.21.13(稳定)来摆脱这个问题。虽然我的 ruby​​ 版本是 1.9.3 而不是 2.x

于 2013-08-09T18:47:08.020 回答