Bugs item #28807, was opened at 2010-12-29 17:41
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=28807&group_id=126

Category: `gem install` command
Group: None
Status: Closed
Resolution: Rejected
Priority: 3
Submitted By: Peter Vandenabeele (peter_v)
Assigned to: Nobody (None)
Summary: option --no-ri and --no-rdoc make gem install fail without -d

Initial Comment:
Context:

p...@pev-desktop:~/data/new-rails$ rvm use 1.8.7
Using /home/pev/.rvm/gems/ruby-1.8.7-p330
p...@pev-desktop:~/data/new-rails$ gem -v
1.3.7

Output of `gem env` and `gem --debug` is below.

`gem install rails --no-doc --no-ri` does not function
when `-d` is not given as an option.

p...@pev-desktop:~/data/new-rails$ rvm gemset create rails3
'rails3' gemset created (/home/pev/.rvm/gems/ruby-1.8.7-p...@rails3).
p...@pev-desktop:~/data/new-rails$ rvm gemset use rails3
Now using gemset 'rails3'
p...@pev-desktop:~/data/new-rails$ gem install rails --no-rdoc --no-ri
WARNING:  RubyGems 1.2+ index not found for:


RubyGems will revert to legacy indexes degrading performance.
ERROR:  Could not find a valid gem 'rails' (>= 0) in any repository



When the -d option is also specified, it works as I had expected.

p...@pev-desktop:~/data/new-rails$ rvm gemset create rails3
'rails3' gemset created (/home/pev/.rvm/gems/ruby-1.8.7-p...@rails3).
p...@pev-desktop:~/data/new-rails$ rvm gemset use rails3
Now using gemset 'rails3'
p...@pev-desktop:~/data/new-rails$ gem install rails -d --no-ri --no-rdoc
Successfully installed activesupport-3.0.3
Successfully installed builder-2.1.2
Successfully installed i18n-0.5.0
Successfully installed activemodel-3.0.3
Successfully installed rack-1.2.1
Successfully installed rack-test-0.5.6
Successfully installed rack-mount-0.6.13
Successfully installed tzinfo-0.3.23
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.3
Successfully installed arel-2.0.6
Successfully installed activerecord-3.0.3
Successfully installed activeresource-3.0.3
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.13
Successfully installed actionmailer-3.0.3
Successfully installed thor-0.14.6
Successfully installed railties-3.0.3
Successfully installed bundler-1.0.7
Successfully installed rails-3.0.3
23 gems installed

The help file says:

p...@pev-desktop:~/data/new-rails$ gem help install
Usage: gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [options]

  Options:
        --platform PLATFORM          Specify the platform of gem to install
    -v, --version VERSION            Specify version of gem to install
        --[no-]prerelease            Allow prerelease versions of a gem
                                     to be installed. (Only for listed gems)


  Install/Update Options:
    -i, --install-dir DIR            Gem repository directory to get installed
                                     gems
    -n, --bindir DIR                 Directory where binary files are
                                     located
    -d, --[no-]rdoc                  Generate RDoc documentation for the gem on
                                     install
        --[no-]ri                    Generate RI documentation for the gem on
                                     install
    -E, --[no-]env-shebang           Rewrite the shebang line on installed
                                     scripts to use /usr/bin/env
...

I had expected from this that I can give _either_  -d
or --no-rdoc and/or --no-ri. I did not expect that
the --no-rdoc or --no-ri option requires the -d option
to be functional.

I suggest a change where either the --no-rdoc or --no-ri option
automatically invoke the -d option.

If there is interest, I could try to write a patch (either changing
the behavior or the help file).

===============
p...@pev-desktop:~/data/new-rails$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2010-12-23 patchlevel 330) [i686-linux]
  - INSTALLATION DIRECTORY: /home/pev/.rvm/gems/ruby-1.8.7-p...@rails3
  - RUBY EXECUTABLE: /home/pev/.rvm/rubies/ruby-1.8.7-p330/bin/ruby
  - EXECUTABLE DIRECTORY: /home/pev/.rvm/gems/ruby-1.8.7-p...@rails3/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/pev/.rvm/gems/ruby-1.8.7-p...@rails3
     - /home/pev/.rvm/gems/ruby-1.8.7-p...@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/";, "http://gems.github.com/";]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com/
==============
p...@pev-desktop:~/data/new-rails$ gem --debug install rails --no-ri --no-rdoc
Exception `NameError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:164
 - uninitialized constant Gem::Commands::InstallCommand
Exception `Gem::LoadError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems.rb:779 - 
Could not find RubyGem test-unit (>= 0)

Exception `SocketError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/http.rb:560 - 
getaddrinfo: Name or service not known
Exception `Gem::RemoteFetcher::FetchError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:180
 - SocketError: getaddrinfo: Name or service not known 
(http://gems.rubyforge.org/latest_specs.4.8.gz)
Exception `EOFError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/protocol.rb:135 - end of 
file reached
Exception `EOFError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/protocol.rb:120 - end of 
file reached
Exception `EOFError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/http.rb:1060 - end of 
file reached
WARNING:  RubyGems 1.2+ index not found for:
        

RubyGems will revert to legacy indexes degrading performance.
Exception `Errno::ENOENT' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:206
 - No such file or directory - 
/home/pev/.rvm/gems/ruby-1.8.7-p...@rails3/latest_source_cache
Exception `EOFError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/protocol.rb:135 - end of 
file reached
Exception `EOFError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/protocol.rb:120 - end of 
file reached
Exception `EOFError' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/http.rb:1060 - end of 
file reached
Updating metadata for 1 gems from http://gems.rubyforge.org/
.
complete
Bulk updating Gem source index for: http://gems.github.com/
Exception `Gem::GemNotFoundException' at 
/home/pev/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:215
 - 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
===================

HTH,

Peter

----------------------------------------------------------------------

>Comment By: Peter Vandenabeele (peter_v)
Date: 2010-12-29 19:26

Message:
Luis,

Many thanks, that solved it !

While I was using a shiny new version of rubygems in
~/.rvm/rubies/ruby-1.8.7-p330/bin/gem

I was indeed still using an outdated version of
.gemrc that was placed there with root permissions
by some older installation process (Debian, ree ?).

Now it works as expected.

Thanks again,

Peter

----------------------------------------------------------------------

Comment By: Luis Lavena (luislavena)
Date: 2010-12-29 17:50

Message:
Peter,

You're having a fluctuating internet connection problem it seems, as the first 
message:

WARNING:  RubyGems 1.2+ index not found for:


RubyGems will revert to legacy indexes degrading performance.
ERROR:  Could not find a valid gem 'rails' (>= 0) in any repository

Indicates that couldn't retrieve the quick index from rubygems.org

And now looking into your gem env:

- REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com/

Seems you're pointing to the old deprecated gems.rubyforge.org

Please change your sources to http://rubygems.org and try again.

Closing this as is not a bug, is a network connectivity issue associated with a 
deprecated repository.


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=28807&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to