-2

我正在通过 Michael Hartl 的书学习 RoR。在第三章中,通过命令 rails new sample_app --skip-unit-test 创建 sample_app 我在运行 bundle intstall 后得到了这个。

/usr/local/lib/ruby/1.9.1/net/http.rb:644:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)
    from /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `open'
    from /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `block in connect'
    from /usr/local/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
    from /usr/local/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
    from /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `connect'
    from /usr/local/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
    from /usr/local/lib/ruby/1.9.1/net/http.rb:632:in `start'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/vendor/net/http/persistent.rb:224:in `connection_for'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/fetcher.rb:145:in `fetch'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/fetcher.rb:173:in `fetch_dependency_remote_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/fetcher.rb:132:in `fetch_remote_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/fetcher.rb:70:in `specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:234:in `block in remote_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:232:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:232:in `remote_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:165:in `fetch_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/source.rb:70:in `specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:205:in `block (2 levels) in index'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:202:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:202:in `block in index'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/index.rb:9:in `build'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:198:in `index'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:192:in `resolve'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/definition.rb:122:in `resolve_remotely!'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/installer.rb:48:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/installer.rb:12:in `install'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/cli.rb:220:in `install'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/bin/bundle:13:in `<main>'
Fetching gem metadata from http://rubygems.org/.Unfortunately, a fatal error has occurred. Please see the Bundler 
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!

尝试了很多东西,比如 gem update --system 并安装 bundler。仍然无法正常工作,我不知道为什么。请帮助

My system details-

ruby -v
>> ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

rails -v
>> Rails 3.1.0

gem -v
>> 2.1.8

我正在使用 Ubuntu 12.04

4

1 回答 1

0

有时,如果您的 gemfile 的顶部是源“ https://rubygems.org ”,则捆绑包会失败,请尝试将 https 更改为 http

于 2013-10-14T21:30:13.507 回答