"ruby/3.0.1 isn't supported by this pry-doc version" error in Mac => Ruby => Pry

786 Views Asked by At

Screenshot of error

How do you solve the following error in Pry in the Mac terminal?

ruby/3.0.1 isn't supported by this pry-doc version

You get this error when you require pry-doc inside of Pry, in order to access Ruby documentation. This happens on today's date, having the latest versions of Ruby, Pry, and Pry-doc.

1

There are 1 best solutions below

0
Luis De On

One solution is to downgrade to the previous version of Ruby, which is 2.7.3, and then reinstall pry and pry-doc.

To do this, enter the following command lines in you terminal in order:

rbenv install 2.7.3

rbenv global 2.7.3

rbenv rehash

Then, the terminal command "ruby -v" should return specifying the current version of Ruby.

Continue with:

gem install bundler pry byebug

gem install pry

gem install pry-doc

Once inside pry, entering the "require 'pry-doc'" command should not raise the error pertaining this question.