6

I installed pry and related gems using the following line in a bash prompt:

gem install pry-plus --no-ri --no-rdoc

Successful gem installation was reported from that command.

All the instructions I've found say that after installing pry I can get to a pry prompt by entering pry as a bash command. However, the actual result is bash: pry: command not found

which pry reports no pry in (...) where the ellipses are $PATH. In contrast, which rake reports /local/tbh/rbenv/shims/rake and which gem reports /local/tbh/rbenv/shims/gem

Why did the command for pry not get created by gem install? How can I get it to work as designed?

(I'm using Ruby 1.9.3 with rbenv (not RVM) under Scientific Linux as a virtual environment.)

3
  • Try rbenv rehash to refresh your shims. Commented Jun 26, 2013 at 18:13
  • Executing rbenv rehash did indeed make the pry command work as advertized. Thanks! Commented Jun 26, 2013 at 18:32
  • Great, I've posted it as an answer for future reference. Commented Jun 26, 2013 at 18:36

1 Answer 1

18

rbenv caches current Ruby executables as so-called shims. You have to run

$ rbenv rehash

after installing a new executable in order to refresh the shims.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.