Home > Net >  Command 'rbenv' not found, but can be installed with
Command 'rbenv' not found, but can be installed with

Time:08-08

I installed rbenv in my Ubuntu system with this command: enter image description here

As you can see the installation was managed by homebrew, I thought git will be in charge of it, however, the installation was successful and I could installed ruby, gems between other.

After I restart my computer and opened a terminal, I found this:

enter image description here

I tried to fix it using the next commands:

enter image description here

It worked during that session, but after close and open my terminal I got the same message but duplicated:

enter image description here

Checking my .bashrc I found this at the end:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
eval "$(rbenv init -)"

I know I had to get rid of the last line, but my question is:

what else do I need to change to fix my rbenv installation?

Thanks a lot

CodePudding user response:

Well in the github repo I can't seem to find the method/script you are using to install.

just use the complete manual approach as specified on the website as of today.

remove every rbenv related line first from your ~/.bashrc, and rm -rf ~/.rbenv then just copy-paste the below lines.

git clone https://github.com/rbenv/rbenv.git ~/.rbenv --depth=1 #shallow clone cuz ig u just want to use it
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc

should work just fine, you get the additional benefit of getting the latest version. whenever you wish to update just cd ~/.rbenv && git pull

comment if still issues.

  • Related