简体   繁体   English

找不到命令“rbenv”,但可以安装

[英]Command 'rbenv' not found, but can be installed with

I installed rbenv in my Ubuntu system with this command:我使用以下命令在我的 Ubuntu 系统中安装了 rbenv: 在此处输入图像描述

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.如您所见,安装是由自制软件管理的,我认为 git 将负责它,但是,安装成功,我可以安装 ruby,其他之间的宝石。

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:它在 session 期间工作,但在关闭并打开我的终端后,我收到了相同的消息,但重复了:

在此处输入图像描述

Checking my.bashrc I found this at the end:检查 my.bashrc 我最后发现了这个:

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?我还需要更改什么来修复我的 rbenv 安装?

Thanks a lot非常感谢

Well in the github repo I can't seem to find the method/script you are using to install.好吧,在 github 存储库中,我似乎找不到您用来安装的方法/脚本。

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.首先从~/.bashrc中删除每个 rbenv 相关行,然后rm -rf ~/.rbenv然后复制粘贴以下行。

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每当你想更新cd ~/.rbenv && git pull

comment if still issues.如果仍有问题,请发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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