Reputation: 41
I want to read documentation of gems in terminal. How can I do this with ri tools? LinuxMint 18.3 Rails 5.1.4
Upvotes: 1
Views: 817
Reputation: 676
First, make sure you have the Docs on your system. They do not always install with a typical Rails installation.
You can download the doc for a specific gem with
gem rdoc [gem-name] --no-rdoc
The --no-rdoc
tells it not to install the HTML version.
If you want the docs for all gems you have installed, you can use
gem rdoc --all --ri --no-rdoc
That may take a few minutes to download.
Once you have the docs downloaded, you can access them with
ri -i
This will give you an interactive prompt where you can search for gems or methods. You can even use tab to autocomplete.
Upvotes: 2