[Rubygems-developers] [ rubygems-Bugs-28807 ] option --no-ri and --no-rdoc make gem install fail without -d

noreply at rubyforge.org noreply at rubyforge.org
Wed Dec 29 11:41:37 EST 2010


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: Open
Resolution: None
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:

pev at pev-desktop:~/data/new-rails$ rvm use 1.8.7
Using /home/pev/.rvm/gems/ruby-1.8.7-p330
pev at 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.

pev at pev-desktop:~/data/new-rails$ rvm gemset create rails3
'rails3' gemset created (/home/pev/.rvm/gems/ruby-1.8.7-p330 at rails3).
pev at pev-desktop:~/data/new-rails$ rvm gemset use rails3
Now using gemset 'rails3'
pev at 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.

pev at pev-desktop:~/data/new-rails$ rvm gemset create rails3
'rails3' gemset created (/home/pev/.rvm/gems/ruby-1.8.7-p330 at rails3).
pev at pev-desktop:~/data/new-rails$ rvm gemset use rails3
Now using gemset 'rails3'
pev at 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:

pev at 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).

===============
pev at 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-p330 at rails3
  - RUBY EXECUTABLE: /home/pev/.rvm/rubies/ruby-1.8.7-p330/bin/ruby
  - EXECUTABLE DIRECTORY: /home/pev/.rvm/gems/ruby-1.8.7-p330 at rails3/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/pev/.rvm/gems/ruby-1.8.7-p330 at rails3
     - /home/pev/.rvm/gems/ruby-1.8.7-p330 at 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/
==============
pev at 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-p330 at 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

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

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=28807&group_id=126


More information about the Rubygems-developers mailing list