Having installed ruby 2.5 on Ubuntu 18.04 I tried using the ri
command with the following result:
$ ri String
Nothing known about String
In answer to similar questions, the advice is offered to:
1. Generate the documentation using the rvm command
$ rvm docs generate
I didn't install using rvm
, so I imagine this option is closed to me.
2. Generate documentation for installed gems
$ gem rdoc --all --ri --no-rdoc
This gave the following error messages:
ERROR: Unable to document did_you_mean-1.2.0, /usr/share/rubygems-integration/all/gems/did_you_mean-1.2.0 is missing, skipping
ERROR: Unable to document minitest-5.10.3, /usr/share/rubygems-integration/all/gems/minitest-5.10.3 is missing, skipping
ERROR: Unable to document net-telnet-0.1.1, /usr/share/rubygems-integration/all/gems/net-telnet-0.1.1 is missing, skipping
ERROR: Unable to document power_assert-0.2.7, /usr/share/rubygems-integration/all/gems/power_assert-0.2.7 is missing, skipping
ERROR: Unable to document rake-12.3.1, /usr/share/rubygems-integration/all/gems/rake-12.3.1 is missing, skipping
Parsing documentation for rdoc-4.3.0
Parsing documentation for rdoc-data-4.1.0
ERROR: Unable to document test-unit-3.2.5, /usr/share/rubygems-integration/all/gems/test-unit-3.2.5 is missing, skipping
3. Use rdoc-data --install
$ gem install rdoc-data
$ rdoc-data --install
This returned the error message:
NOTE: Gem.datadir is deprecated; use spec.datadir instead. It will be removed on or after 2016-10-01.
Gem.datadir called from /var/lib/gems/2.5.0/gems/rdoc-data-4.1.0/lib/rdoc/data.rb:50.
Your ruby version 2.5 is not supported, only 1.8, 1.9, 2.0, 2.1, 2.2, 2.3
Perhaps this installed an obsolete version of the rdoc-data
gem? If so, is there some way to fix that?
4. Generate docs from source
$ tar xvfz ~/Downloads/ruby-2_5_4.tar.gz
$ cd ruby-2_5_4
$ rdoc --all --ri
This gives the error:
Traceback (most recent call last):
1: from /usr/local/bin/rdoc:23:in `<main>'
/usr/local/bin/rdoc:23:in `load': cannot load such file -- /usr/lib/ruby/gems/2.5.0/gems/rdoc-6.0.1/exe/rdoc (LoadError)
And indeed, the exe directory contains the file rdoc2.5
and not plain rdoc
.
So. Where to go from here?