1

ubuntulinuxにrubyruby1.8.7(2011-02-18 patchlevel 334)[x86_64-linux]をインストールし、rails 2.3.8 gemをインストールしようとしていますが、次のエラーが発生します。

gem install rails --debug

 gem install rails --debug
Exception `NameError' at /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand
Exception `Errno::ETIMEDOUT' at /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/http.rb:560 - Connection timed out - connect(2)
Exception `Gem::RemoteFetcher::FetchError' at /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:246 - Errno::ETIMEDOUT: Connection timed out - connect(2) (http://gems.rubyforge.org/latest_specs.4.8.gz)
Exception `Gem::GemNotFoundException' at /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:237 - Could not find a valid gem 'rails' (>= 0) locally or in a repository
ERROR:  Could not find a valid gem 'rails' (>= 0) in any repository
Exception `Errno::ETIMEDOUT' at /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/http.rb:560 - Connection timed out - connect(2)
Exception `Gem::RemoteFetcher::FetchError' at /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:246 - Errno::ETIMEDOUT: Connection timed out - connect(2) (http://gems.rubyforge.org/latest_specs.4.8.gz)
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: Connection timed out - connect(2) (http://gems.rubyforge.org/latest_specs.4.8.gz)
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:246:in `fetch_path'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:269:in `load_specs'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:231:in `list'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:227:in `each'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:227:in `list'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:189:in `suggest_gems_from_name'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/command.rb:160:in `show_lookup_failure'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:132:in `execute'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `each'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `execute'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:147:in `process_args'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:117:in `run'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:65:in `run'
    /usr/local/rvm/rubies/ruby-1.8.7-p334/bin/gem:34

    RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-1.8.7-p334
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-1.8.7-p334/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-1.8.7-p334/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-1.8.7-p334
     - /usr/local/rvm/gems/ruby-1.8.7-p334@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/", "http://rubygems.org"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://rubygems.org
4

1 に答える 1

1

geminstallのproxyコマンドオプションを使用してこの問題を修正しました。次の形式です。

$ gem install --http-proxy http://201.187.107.19:8080 rails

IPアドレスとポート番号はプロキシを参照していることに注意してください。プロキシリストを検索し、そこでプロキシの1つを使用する必要があります。

これはプロキシのあるサイトです:http ://www.cybersyndrome.net/pla5.html

また、成功するには、7つまたは8つの異なるプロキシを試す必要があります。あきらめないでください。

次のエラーも表示される可能性があることに注意してください。

ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: rails requires activesupport (= 3.2.8), actionpack (= 3.2.8), activerecord (= 3.2.8), activeresource (= 3.2.8), actionmailer (= 3.2.8), railties (= 3.2.8), bundler (~> 1.0)

諦めずに、リストの次のプロキシを続行してください。幸運を。

于 2013-03-18T21:14:57.017 に答える