Long story made short, I am trying to issue myself an SSL certificate using LetsEncrypt, and have recently installed rbenv to make this process easier. After installing rbenv, I check to see if everything checks out using
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
I than get this message saying that there are no versions of ruby installed. After trying to install ruby using the command
"rbenv install 2.3.1"
I get this error
rbenv: no such command `install'
Is it because the path to my rbenv shims aren't in my PATH variable ? If this is the case how do I add directories to my PATH variable ? I know you have to add them to your bash_profile file, but am not sure where in this file I need to add something, and what I need to add.
~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
function letsencrypt_webfaction {
PATH=$PATH:$GEM_HOME/bin GEM_HOME=$HOME/.letsencrypt_webfaction/gems RUBYLIB=$GEM_HOME/lib ruby2.2 $HOME/.letsencrypt_webfaction/gems/bin/letsencrypt_webfaction $*
}
eval "$(rbenv init -)"
PATH=$PATH:$HOME/bin
export PATH
export PATH="$HOME/.rbenv/bin:$PATH"
Always be careful when editing the profile.
Better make a backup first
cd
ls -la .bash*
cp -p .bash_profile .bash_profile.bak
echo $PATH
which ruby
ruby --version
I am not sure where this function is comming from in your .bash_profile:
function letsencrypt_webfaction()
Use
:
as a separator and add a new directorynew_dir
to your PATH, use$PATH
to keep the contents of the actual PATH, then export the new PATH:Verify if the PATH is what you need from the terminal:
echo $PATH
Personaly I sugest making a backup of .bash_profile as it is. Comment out with
#
the 3 lines for the function and the others where the PATH appears and add this:After this please check the bulet points above and see if you have the ruby version you expect.