Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
708 views
in Technique[技术] by (71.8m points)

ruby - How to remove installed ri and rdoc?

How can I remove the ri and rdoc of installed gems? Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

  • RubyGems will try to install to your user directory (something like ~/.gem/ruby/1.8/) if it can't access the normal installation directory (e.g. you installed a gem without sudo).
  • RVM also installs RubyGems for each Ruby it installs which will contain a 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...