`initialize':Rails 新应用程序时没有这样的文件或目录 - getaddrinfo (Errno::ENOENT) [英] `initialize': No such file or directory - getaddrinfo (Errno::ENOENT) when Rails new app

查看:48
本文介绍了`initialize':Rails 新应用程序时没有这样的文件或目录 - getaddrinfo (Errno::ENOENT)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I try to create a rails app in rails 4.00 with ruby ruby-2.0.0-p247. While bundle install processes, it shows an error: initialize: No such file or directory. Below is output of error

 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!

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

What should i do to solve this problem?

推荐答案

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

I just had a similar issue and after reinstalling rvm (a headache) a couple days later it came back. This time I tried using comments to isolate which gems in my Gemfile were causing the problem. I noticed it was new gems. Then I tried to simply

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)

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

This made me think I wasn't connected to the internet. Once I connected again.

捆绑工作!

bundle install

这篇关于`initialize':Rails 新应用程序时没有这样的文件或目录 - getaddrinfo (Errno::ENOENT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆