我一直在使用google_currency gem取得了巨大的成功,但现在我开始获得一个Errno :: ENETUNREACH:网络无法访问 - connect(2)for“www.google.com”。
我无法想到会造成这种情况的任何改变。有没有人对这可能是什么有任何想法?我已经尝试更新到最新的宝石版本但没有效果。我也从我的开发环境尝试过telnet google.com 80,它没有问题就连接了。
完整追踪:
rake aborted!
Errno::ENETUNREACH: Network is unreachable - connect(2) for "www.google.com" port 80
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/net/http.rb:879:in `initialize'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/net/http.rb:879:in `open'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/timeout.rb:76:in `timeout'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/net/http.rb:878:in `connect'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/net/http.rb:852:in `start'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:313:in `open_http'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:724:in `buffer_open'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:210:in `block in open_loop'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:208:in `catch'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:208:in `open_loop'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:149:in `open_uri'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:704:in `open'
/home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/open-uri.rb:712:in `read'
/home/action/.gem/ruby/2.1.1/gems/google_currency-3.2.0/lib/money/bank/google_currency.rb:128:in `fetch_rate'
/home/action/.gem/ruby/2.1.1/gems/google_currency-3.2.0/lib/money/bank/google_currency.rb:99:in `block in get_rate'
/home/action/.gem/ruby/2.1.1/gems/google_currency-3.2.0/lib/money/bank/google_currency.rb:98:in `synchronize'
/home/action/.gem/ruby/2.1.1/gems/google_currency-3.2.0/lib/money/bank/google_currency.rb:98:in `get_rate'
/home/action/workspace/x/lib/tasks/import_newstyle.rake:22:in `block in <top (required)>'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/task_manager.rb:209:in `in_namespace'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/dsl_definition.rb:146:in `namespace'
/home/action/workspace/x/lib/tasks/import_newstyle.rake:1:in `<top (required)>'
/home/action/.gem/ruby/2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
/home/action/.gem/ruby/2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load'
/home/action/.gem/ruby/2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
/home/action/.gem/ruby/2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
/home/action/.gem/ruby/2.1.1/gems/railties-4.1.0/lib/rails/engine.rb:654:in `block in run_tasks_blocks'
/home/action/.gem/ruby/2.1.1/gems/railties-4.1.0/lib/rails/engine.rb:654:in `each'
/home/action/.gem/ruby/2.1.1/gems/railties-4.1.0/lib/rails/engine.rb:654:in `run_tasks_blocks'
/home/action/.gem/ruby/2.1.1/gems/railties-4.1.0/lib/rails/application.rb:362:in `run_tasks_blocks'
/home/action/.gem/ruby/2.1.1/gems/railties-4.1.0/lib/rails/engine.rb:449:in `load_tasks'
/home/action/workspace/x/Rakefile:6:in `<top (required)>'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/home/action/.gem/ruby/2.1.1/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/home/action/.gem/ruby/2.1.1/bin/rake:23:in `load'
/home/action/.gem/ruby/2.1.1/bin/rake:23:in `<main>'
答案 0 :(得分:0)
如果您在服务器上工作,那么帮助我的就是重新启动服务器,希望对您有所帮助。我不确定该如何解决问题,因为我在FreeBSD服务器上工作。重新启动服务器对我有帮助。