ruby 版本不在 rbenv 的 ruby-build 列表中 [英] Ruby version not in ruby-build list for rbenv
问题描述
我正在使用 Rails 4.2,并想用 rbenv 更新我的 Ruby 版本.
I'm using Rails 4.2 and wanted to update my Ruby version as well with rbenv.
我使用 Homebrew 安装 ruby-build,无论我尝试通过 brew
更新多少次,运行 rbenv install 时都不会显示 Ruby 版本 2.1.3 --列表
.
I used Homebrew to install ruby-build and no matter how many times I try to update via brew
, Ruby version 2.1.3 won't show when I run rbenv install --list
.
推荐答案
如果你用 homebrew 安装了 rbenv 和 ruby-build 并且当你执行 echo $(rbenv root)
时,你会得到 /usr/local/var/rbenv
而不是 /Users/
,这里是解决问题的方法.
If you installed rbenv and ruby-build with homebrew and when you do echo $(rbenv root)
, you get /usr/local/var/rbenv
instead of /Users/<username>/.rbenv
, here is how to fix the issue.
当你用 homebrew 安装 rbenv 时,homebrew 说:
When you install rbenv with homebrew, homebrew says:
To use Homebrew's directories rather than ~/.rbenv add to your profile:
export RBENV_ROOT=/usr/local/var/rbenv
不要那样做.从您的个人资料中删除该行.确保在之后刷新终端.
Don't do that. Remove that line from your profile. Make sure you refresh your terminal after.
然后删除/usr/local/var 目录中任何 rbenv 的迹象:
Then remove any signs of rbenv in the /usr/local/var directory:
sudo rm -r /usr/local/var/rbenv
现在当我执行 echo $(rbenv root)
我得到 /Users/
而不是 /usr/local/var/rbenv
.
Now when I do echo $(rbenv root)
I get /Users/<username>/.rbenv
instead of /usr/local/var/rbenv
.
那为我修好了.
这篇关于ruby 版本不在 rbenv 的 ruby-build 列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!