1

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?

1 Answer 1

2

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.

2
  • 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? Commented Mar 14, 2014 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 :) Commented Mar 14, 2014 at 1:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.