I've been trying to install rbenv on my fresh Debian 7.4 install, per the instructions here.

I follow all the steps on the guide, and they all work fine: I can use rbenv to install Rubies and gems just fine.

But if I close the terminal and start a new shell I see this:

bash: rbenv: command not found

What gives?


You're following a tutorial made for OSX. For reasons I have never understood, OSX decided to make their non-login shells source ~/.bash_profile and ~/.profile etc instead of the usual ~/.bashrc and its ilk. If you have no idea what I'm talking about, see here.

Anyway, the tutorial tells you to run

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

Which will add the line to ~/.bash_profile which is ignored by non-login shells on Linux. Instead, you want to do this:

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc

Now, open a new terminal and everything should be fine.

  • Oh my god, you're my hero. Thanks for the excellent reference, as well. How should I have known the tutorial was specific to OSX? Just keep an eye out for .bash-profile and .bashrc mixups? – Chase May Mar 14 '14 at 0:59
  • @ChaseMay that's one hint yeah, that's what tipped me off cause I happened to know about this difference. The author does not state it implicitly, she/he probably assumes that it works on both. The article does mention macs but also Linux and Unix so don't blame yourself :) – terdon Mar 14 '14 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.