show-doc not working in ruby pry

Cause of error show-doc not working in ruby pry

When one needs the pry-doc inside of Pry to access Ruby documentation, you receive this error show-doc not working in ruby pry. With the most recent versions of Ruby, Pry, and Pry-doc, this occurs today. The error message occurs as follows:

Solution 

Pry is a different Ruby REPL with some extra features. You are entering a brand-new interactive environment when you enter IRB. You must write in IRB or copy and paste any code you want to experiment with. On the other side, Pry is similar to an injectable REPL that you can use in your program.

Like IRB on steroids, Pry. The REPL commands Read, Evaluate, Print, and Loop are used by both IRB and Pry. However, Pry gives you more debugging flexibility. For instance, Pry has color-coded syntax, which is useful when attempting to predict what will happen when code is run.

One approach is to reinstall pry and pry-doc after downgrading to Ruby 2.7.3, which is the prior version.

To accomplish this, type the following command lines sequentially into your terminal:

 

rbenv install 2.7.3

rbenv global 2.7.3

rbenv rehash

The current version of Ruby should then be displayed using the “ruby -v” terminal command.

proceed with:

 

gem install bundler

pry byebug

gem install

pry

gem install pry-doc

 

Once within pry, using the command “require ‘pry-doc'” shouldn’t cause the issue mentioned in this sentence.

 

Also Read: pip install aplaca trade api

 

 

Share this post

10 thoughts on “show-doc not working in ruby pry

Leave a Reply

Your email address will not be published. Required fields are marked *