0

我正在使用 OS X 10.7、ruby 1.8.7(2010-01-10 补丁级别 249)和 rails 3.2.1、rubygems 1.8.24:

➜  code  ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
➜  code  gem list | grep rails 
rails (3.2.1, 3.2.0, 3.1.0, 3.0.5)
➜  code  gem list | grep gem   
rubygems-update (1.8.24)

至于 gem 的来源:

➜  code  gem sources                                                     
*** CURRENT SOURCES ***
http://gems.rubyforge.org
http://gems.github.com
http://gems.github.com
http://gems.github.com
http://production.s3.rubygems.org
http://production.s3.rubygems.org.s3.amazonaws.com/
http://rubygems.org/

现在我正在尝试创建一个 rails 项目:

➜  code  rails new blogging -d mysql
Using #!/usr/bin/ruby begin require 'hirb' # sudo gem install cldwalker-hirb --source http://gems.github.com Hirb.enable rescue LoadError end def change_log(stream) ActiveRecord::Base.logger = Logger.new(stream) ActiveRecord::Base.clear_active_connections! end def show_log change_log(STDOUT) end def hide_log change_log(nil) end from /Users/Apple/.railsrc
      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  lib/assets
      create  lib/assets/.gitkeep
      create  log
      create  log/.gitkeep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/index.html
      create  public/robots.txt
      create  script
      create  script/rails
      create  test/fixtures
      create  test/fixtures/.gitkeep
      create  test/functional
      create  test/functional/.gitkeep
      create  test/integration
      create  test/integration/.gitkeep
      create  test/unit
      create  test/unit/.gitkeep
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.gitkeep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Enter your password to install the bundled RubyGems to your system: 
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2) 

Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/gems/i18n-0.6.0.gem)
An error occured while installing i18n (0.6.0), and Bundler cannot continue.
Make sure that `gem install i18n -v '0.6.0'` succeeds before bundling.

我手动安装了 i18n,但仍然遇到同样的错误,我向 gem 添加了新资源,但没有运气。

任何帮助将不胜感激。

在此先感谢

4

2 回答 2

2

首先,Rails 3.2 是最后一个支持 ruby​​ 1.8 的版本,推荐使用 1.9.2 或 1.9.3。

但是对于您的问题:它看起来像 DNS 问题。curl您可以通过/wget或您的浏览器(如果是普通计算机)直接访问 ruby​​gems.org吗?

您还可以运行traceroute rubygems.org并查看连接失败的位置(我不太确定 OS X 上是 traceroute 还是 tracert)

我的最后一个想法是运行ping rubygems.org并尝试运行 traceroute 到返回的 IP

于 2012-05-14T17:31:17.173 回答
0

如果您的互联网连接有点不可靠,就会发生这种错误。

我发现使用公开可用的 wifi 给了我这个错误,但是当我从智能手机连接时运行 bundle 工作。

于 2016-02-10T01:05:35.780 回答