Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent installing documentation for gems automatically using gem v. 2.0

Previously set up my system to suppress installing gem documentation with --no-ri and --no-rdoc.

Ruby 2.0.0 and gem 2.0.0 seems to have removed the --no-ri flag (and functionality?).

Even when specifying --no-rdoc, I still get installing documentation:

~/dev/ruby> gem install bundler --no-rdoc
Fetching: bundler-1.3.1.gem (100%)
Successfully installed bundler-1.3.1
Done installing documentation for bundler (0 sec).

How to see whether or not documentation is installed? If it is installed, how to suppress for all gem installs?

like image 662
B Seven Avatar asked Mar 03 '13 21:03

B Seven


People also ask

How do I install a specific version of a gem?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

What is the difference between gem install and bundle install?

Almost seems like running 'gem install' adds it to the global available gems (and hence terminal can run the package's commands), whereas adding it to the gemfile and running bundle install only adds it to the application. Similar to npm install --global. that's basically it.

How do I resolve gem dependencies?

Common Attempts To Resolve Ruby Gem Dependencies Bundler can help to resolve dependencies when working with Ruby gems by allowing you to specify a set of gems in a Gemfile, then issue a single command to install them. Bundler then automatically resolves the dependencies for you.

What is gem install command?

The install command installs local or remote gem into a gem repository. For gems with executables ruby installs a wrapper file into the executable directory by default.

What does the gem install command do?

The install command downloads and installs the gem and any necessary dependencies then builds documentation for the installed gems. $ gem install drip Fetching: rbtree-0.4.1.gem (100%) Building native extensions. This could take a while...

How do I disable documentation generation when installing Ruby gems?

Ruby installs the dependency rbtree and builds its extension, installs the drip gem, then builds documentation for the installed gems. You can disable documentation generation using the --no-doc argument when installing gems.

How do I know if RubyGems is installed or not?

The list command shows your locally installed gems: (Ruby ships with some gems by default, bigdecimal, io-console, json, minitest, psych, rake, rdoc, test-unit for ruby 2.0.0). The uninstall command removes the gems you have installed. If you uninstall a dependency of a gem RubyGems will ask you for confirmation.

How do I audit a gem without installing it?

RBTree is a subclass of MultiRBTree. ------------------------------------------- If you wish to audit a gem’s contents without installing it you can use the fetch command to download the .gem file then extract its contents with the unpack command.


2 Answers

As gem help install states:

Usage: gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [options]
...
  Install/Update Options:
    ...
        --[no-]document [TYPES]      Generate documentation for installed gems
                                     List the documentation types you wish to
                                     generate.  For example: rdoc,ri
    -N, --no-document                Disable documentation generation

In short:

  • --no-rdoc is now --no-document rdoc

  • --no-ri is now --no-document ri.

  • You can prevent both from installing with either --no-document or -N.

(Unfortunately as of this writing the documentation on Rubygems.org is currently out-of-date, so ignore that for now.)

like image 192
Andrew Marshall Avatar answered Sep 27 '22 22:09

Andrew Marshall


The option has changed to --no-document (see http://rubygems.rubyforge.org/rubygems-update/History_txt.html)

like image 41
Andy Waite Avatar answered Sep 27 '22 23:09

Andy Waite