我怎样才能为宝石安装ri和rdoc文件?

时间:2021-08-16 06:52:38

I normally don't need ri and rdoc, so I write in ~/.gemrc like this.

我通常不需要ri和rdoc,所以我这样写〜/ .gemrc。

install: --no-ri --no-rdoc
update: --no-ri --no-rdoc

I want to install them afterwards when I have time. How can I install ri and rdoc files for installed gems afterwards?

我有空的时候想安装它们。之后如何为已安装的gem安装ri和rdoc文件?

2 个解决方案

#1


10  

# See the relevant help.
gem help rdoc

# Generate rdoc and ri for the "foo" gem.
gem rdoc --ri foo

# Generate rdoc for all installed gems.
gem rdoc --all

#2


1  

According to chapter 10 of the RubyGems Command reference, you can use gem rdoc to install rdoc.

根据RubyGems命令参考的第10章,您可以使用gem rdoc来安装rdoc。

Here is an excerpt...

这是摘录......

Usage: gem rdoc [args] [options]

  Options:
        --all                        Generate RDoc documentation for all installed gems
    -v, --version VERSION            Specify version of gem to rdoc

  Common Options:
        --source URL                 Use URL as the remote source for gems
    -p, --[no-]http-proxy [URL]      Use HTTP proxy for remote operations
    -h, --help                       Get help on this command
        --config-file FILE           Use this config file instead of default
        --backtrace                  Show stack backtrace on errors
        --debug                      Turn on Ruby debugging

  Arguments:
    GEMNAME          The gem to generate RDoc for (unless --all)

  Summary:
    Generates RDoc for pre-installed gems

  Defaults:
    --version '> 0.0.0'

#1


10  

# See the relevant help.
gem help rdoc

# Generate rdoc and ri for the "foo" gem.
gem rdoc --ri foo

# Generate rdoc for all installed gems.
gem rdoc --all

#2


1  

According to chapter 10 of the RubyGems Command reference, you can use gem rdoc to install rdoc.

根据RubyGems命令参考的第10章,您可以使用gem rdoc来安装rdoc。

Here is an excerpt...

这是摘录......

Usage: gem rdoc [args] [options]

  Options:
        --all                        Generate RDoc documentation for all installed gems
    -v, --version VERSION            Specify version of gem to rdoc

  Common Options:
        --source URL                 Use URL as the remote source for gems
    -p, --[no-]http-proxy [URL]      Use HTTP proxy for remote operations
    -h, --help                       Get help on this command
        --config-file FILE           Use this config file instead of default
        --backtrace                  Show stack backtrace on errors
        --debug                      Turn on Ruby debugging

  Arguments:
    GEMNAME          The gem to generate RDoc for (unless --all)

  Summary:
    Generates RDoc for pre-installed gems

  Defaults:
    --version '> 0.0.0'