Following the instructions here, and everything works fine manually. However, when I use the instructions in a bash script, I get rbenv command not found
because the source ~/.bashrc
didn't execute correctly. What's going on? Feel like I've run into this before on something else...
*Execute bit is set, ran dos2unix, and have #!/bin/bash
at the top.
#!/bin/bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.3.1