I am fresh to Linux Ubuntu and I have messed up my Ruby on Rails install. Therefore, I uninstalled Ruby and attempted to follow the rbenv installation. However, I am getting this stack trace:
martin@martyux:~$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
Checking for `rbenv' in PATH: multiple
You seem to have multiple rbenv installs in the following locations.
Please pick just one installation and remove the others.
/home/martin/.rbenv/bin/rbenv
/usr/bin/rbenv
/bin/rbenv
Checking for rbenv shims in PATH: not found
The directory `/home/martin/.rbenv/shims' must be present in PATH for rbenv to work.
Please run `rbenv init' and follow the instructions.
Checking `rbenv install' support: /home/martin/.rbenv/plugins/ruby-build/bin/rbenv-install (ruby-build 20210119)
Counting installed Ruby versions: none
There aren't any Ruby versions installed under `/home/martin/.rbenv/versions'.
You can install Ruby versions like so: rbenv install 2.2.4
Checking RubyGems settings: OK
Auditing installed plugins: OK
I am assuming that there's instances of rbenv I attempted to install earlier and somehow is still linked to $PATH. I didn't find anyone with this exact issue and I am not competent at navigating the Unix shell yet, so I would appreciate some thorough help.
I don't know how you got rbenv to end up in /bin/rbenv
and usr/bin/rbenv
, but for what I can see from their installation guide you only need ~/.rbenv/bin/rbenv
.
Assuming you use bash, I think these are all added to your $PATH
in ~/.bashrc
. You should find something like:
export PATH="$PATH:/bin/rbenv"
And
export PATH="$PATH:/usr/bin/rbenv"
You can remove those lines. To clean up properly you can also remove the rbenv installs they refer to as well.
Lastly, as the error message says, you want to run rbenv init
after doing this to create the shims
folder.