如何删除已安装的 ri 和 rdoc? [英] How to remove installed ri and rdoc?
本文介绍了如何删除已安装的 ri 和 rdoc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何删除已安装 gem 的 ri
和 rdoc
?谢谢
How can I remove the ri
and rdoc
of installed gems? Thanks
推荐答案
你可以在RubyGems安装目录中删除doc
目录.
You can simply remove the doc
directory in the RubyGems installation directory.
rm -r `gem env gemdir`/doc
在 Mac OS X 上,默认为 /Library/Ruby/Gems/1.8/doc
.
On Mac OS X by default, it's /Library/Ruby/Gems/1.8/doc
.
请记住,RubyGems 可能有多个安装目录.
Keep in mind that there might be several installation directories for RubyGems.
- 如果RubyGems 无法访问正常的安装目录(例如,您安装了一个没有<代码>sudo).
- RVM 还为它安装的每个 Ruby 安装 RubyGems,该目录将包含一个
doc
目录,其中包含rdoc
和ri
文件(例如~/.rvm/gems/ruby-1.9.2-preview1/doc
).
- 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 withoutsudo
). - RVM also installs RubyGems for each Ruby it installs which will contain a
doc
directory containingrdoc
andri
files (e.g.~/.rvm/gems/ruby-1.9.2-preview1/doc
).
这只会删除现有文件,但无论如何新安装都会附带新文件,除非您使用 --no-document
标志进行 gem install 或 将其设为默认值.
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.
这篇关于如何删除已安装的 ri 和 rdoc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文