简体   繁体   中英

Command 'rbenv' not found, but can be installed with

I installed rbenv in my Ubuntu system with this command: 在此处输入图像描述

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:

在此处输入图像描述

I tried to fix it using the next commands:

在此处输入图像描述

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

在此处输入图像描述

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM