How can I remove the ri
and rdoc
of installed gems? Thanks
You can simply remove the doc
directory in the RubyGems installation directory.
rm -r `gem env gemdir`/doc
On Mac OS X by default, it's /Library/Ruby/Gems/1.8/doc
.
Keep in mind that there might be several installation directories for RubyGems.
~/.gem/ruby/1.8/
) if it can't access the normal installation directory (e.g. you installed a gem without sudo
).doc
directory containing rdoc
and ri
files (e.g. ~/.rvm/gems/ruby-1.9.2-preview1/doc
).This will merely remove existing files, but new ones will come with new installations anyway, unless you use the --no-document
flag for gem install or make it a default.
It worked for me when I tried this:
gem rdoc <gem name> --no-ri --overwrite
Then you can remove only ri of the gem, and leave the gem itself. I don't see we need any other way around for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With