123

When using gem install gem_name I can pass --no-rdoc and --no-ri switches to skip generating RDoc/RI documentation for the gem on install.

Is there a similar way to do this with bundle install?

deb
  • 11,756
  • 20
  • 65
  • 84
  • 4
    As explained by Timbinous (2nd most voted answer), Bundler does this by DEFAULT – Cec Aug 19 '16 at 08:17

4 Answers4

266

Bundler doesn't include rdoc and ri. There is nothing you need to do.

Timbinous
  • 2,843
  • 1
  • 15
  • 9
  • 14
    So I see I'm downvoted 5 times. Can anyone explain how I am wrong? Bundler does not include RDoc and RI files when you install gems using `bundle install`. People wanted this as a feature to allow you to install the documentation but they just don't allow it. – Timbinous Sep 12 '14 at 09:11
  • 19
    Timbinous [is right](https://github.com/bundler/bundler/issues/383). It is not only correct, it should be the accepted answer because it actually answers the question. Damn shame people are herd-downvoting a correct answer when they know nothing. – p4sh4 Feb 10 '15 at 03:51
  • 15
    Just so I'm clear Cyril. When he asks is there a similar way to do this with bundle install? Telling him that bundler already does this for you by default is not actually solving his problem. He never had a problem to begin with. I was telling him that. – Timbinous Feb 16 '15 at 03:37
160

Make a file ~/.gemrc and put this in it:

gem: --no-rdoc --no-ri

That should make it apply whenever you run the gem command. (Even from bundle install)

Mitch Dempsey
  • 36,881
  • 6
  • 65
  • 73
19

See https://stackoverflow.com/a/7662245/109618 for a better ~/.gemrc:

install: --no-rdoc --no-ri 
update:  --no-rdoc --no-ri
Community
  • 1
  • 1
David J.
  • 29,957
  • 20
  • 115
  • 170
11

The up-to-date setting for ~/.gemrc is

gem: --no-document

But as pointed out, this is already bundler's default.

thisismydesign
  • 14,900
  • 8
  • 89
  • 91
  • Works with gem 2.x – Kris Aug 13 '19 at 13:09
  • 1
    Since Ruby 2.5 ["Merge RubyGems 3.0.1. The --ri and --rdoc options have been removed. Please use the --document and --no-document options instead."](https://archive.ph/XBiY9). All the other answers are outdated. – de-russification Mar 08 '22 at 11:21