Is there a way to view docs for all gems in a project?

Viewed 92

I'm currently working my way through the Rust language introduction docs, and I was pretty impressed by the package manager Cargo.

Calling cargo doc --open in a project directory opens a browser window which shows the documentation for the project, as well as the docs for each crate (package) used in the project.

Is there a similar command - maybe in Bundler, Rake or some other gem - that generates and displays documentation for all gems used in a Ruby application?

1 Answers

Yes, it is part of RubyGems - specifically, the gem command (the same one used to install gems).

To view info for the gems installed to your system e.g. the ones you installed via gem install and not through a Gemfile, you use gem server and then visit the web interface at http://localhost:8808

To see documentation for only gemfile-specific packages, you can use bundle exec gem server.

Related