rubyrdoc

View a rdoc file in a ruby gem


I want to read some of the documentation for the rb-gsl gem. For example the rdoc file for the multimin class. How do I view this file in a browser and follow the links that are in the file (which appear to refer to other rdoc files in the same repository).


Solution

  • There are at least two options I know of to view rdoc documentation for gems:

    1. Using the online documentation - for example: https://rdoc.info/github/SciRuby/rb-gsl/
    2. Using Yard

    With Yard, you can do many things, including running a local server to show the documentation for all the installed gems.

    $ gem install yard
    $ yard server --gems --port 3000
    

    Then, visit http://localhost:3000 to see a list of gems, each with its full documentation.