Search code examples
rubyrdoc

How to view core ruby documentation locally?


I have installed Ruby 2.0.0 with rvm and want to have local html documentation. So I run

$ rvm docs generate
Installing rdoc-data................................................................
Generating gems documentation.......
$ rvm docs open
rdoc docs are missing, perhaps run 'rvm docs generate' first?

What is wrong?


Solution

  • Here's what works for me for RVM:

    rdoc $MY_RUBY_HOME -o ~/ruby_docs
    

    That puts the HTML documentation for the core and standard libraries in your $HOME/ruby_docs directory. Then, if you're on Mac OS, simply run:

    open ~/ruby_docs/index.html
    

    or navigate to the directory and open index.html somehow for other OSes.