rubyri

What is the correct way to exit RI?


What is the right combination for exit RI on Ubuntu(13.04)?

For example, the following line:

ri GC::enable

gives me:

enter image description here

pressing the following commands do nothing: PAUSE/BREAK, Home, End, Ctrl+Shift+D

The only thing that exist is ctrl+c but it throws errors like this:

from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/lib/rdoc/ri/driver.rb:774:in display_class' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/lib/rdoc/ri/driver.rb:800:in display_name' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/lib/rdoc/ri/driver.rb:827:in block in display_names' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/lib/rdoc/ri/driver.rb:824:in each' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/lib/rdoc/ri/driver.rb:824:in display_names' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/lib/rdoc/ri/driver.rb:1361:in run' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/lib/rdoc/ri/driver.rb:356:in run' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/gems/rdoc-4.0.1/bin/ri:12:in ' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/bin/ri:23:in load' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/bin/ri:23:in' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in eval' from /home/gotqn/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in '

and something more, even it seems the RI has been stopped, but pressing any of the keys gives me again this:

enter image description here


Solution

  • Press q.

    ri pipes the output through what's called a pager. The pager on most systems is a program that is named either more or less. See the manpages for those commands for more information (man more or man less).

    You can set your pager through the environment variable PAGER in the shell. For example on my machine in bash:

    > echo $PAGER
    /usr/bin/less