Sunny
Sunny

Reputation: 478

Not able to install rails 2.3.8

I have installed ruby ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux] on ubuntu linux and I am trying to install rails 2.3.8 gem but i am facing following error.

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

Upvotes: 1

Views: 814

Answers (1)

gotqn
gotqn

Reputation: 43666

I have fixed this issue using the proxy command option of gem install. It has the following format:

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

Note, the IP address and the port number refers to a proxy. You should search for a proxy list and use one of the proxies there.

This is site with proxies: http://www.cybersyndrome.net/pla5.html

Also, I have to try 7 or 8 different proxies in order to succeed. Do not give up.

Note, you could see the following error, too:

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)

Don't give up and continue with the next proxy from the list. Good luck.

Upvotes: 1

Related Questions