ruby rbenv install --list 未列出版本 2.1.2
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23702954/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
rbenv install --list does not list version 2.1.2
提问by levy
I installed rbenv via Homebrew on a OS X 10.9.3 MacBook Pro.
我在 OS X 10.9.3 MacBook Pro 上通过 Homebrew 安装了 rbenv。
I did:
我做了:
brew update
brew upgrade rbenv ruby-build
According to rbenv install --liston my laptop Ruby 2.1.0-dev is the latest.
根据rbenv install --list我的笔记本电脑 Ruby 2.1.0-dev 是最新的。
Does anyone know what this is about? I'm going to guess it's a 10.9.3 problem.
有谁知道这是关于什么的?我猜这是 10.9.3 的问题。
回答by the Tin Man
Both rbenv and ruby-build are generally installed from Github by cloning; That's how the authors recommend we install it.
rbenv 和 ruby-build 一般都是通过克隆从 Github 安装的;这就是作者建议我们安装它的方式。
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
If you didn't do it that way I'd recommend that method. Then, you can simply do:
如果你没有这样做,我会推荐这种方法。然后,您可以简单地执行以下操作:
cd ~/.rbenv
git pull
cd plugins/ruby-build
git pull
If you have several plugins use:
如果您有多个插件,请使用:
cd plugins
for i in *
do
cd $i
git pull
cd -
done
I update every couple weeks just to pull in the latest fixes/changes.
我每两周更新一次,以获取最新的修复/更改。
回答by Venkatesh Nannan
I faced the same issue. I got the latest by running the following command:
我遇到了同样的问题。我通过运行以下命令获得了最新信息:
brew upgrade --HEAD ruby-build
回答by GrahamSherry
I had this issue on OS X 10.8.5 (so don't think OS related). I had tried updating rbenv & ruby-build via brew. 2.1.0-dev was still latest build available.
我在 OS X 10.8.5 上遇到了这个问题(所以不要认为与操作系统相关)。我曾尝试通过 brew 更新 rbenv 和 ruby-build。2.1.0-dev 仍然是可用的最新版本。
I had to force uninstall and re-install ruby-build via brew to fix the issue.
我不得不通过 brew 强制卸载并重新安装 ruby-build 来解决这个问题。
brew uninstall ruby-build --force
brew install ruby-build
回答by Tomohiro Koana
I had the same issue. Even after running
我遇到过同样的问题。即使在运行后
brew upgrade rbenv ruby-build
I still didn't get ruby-2.1.2 on the available list. Following how to update list of available ruby versions on linux, I updated ruby-build through the following commands
我仍然没有在可用列表中找到 ruby-2.1.2。按照如何在 linux 上更新可用 ruby 版本列表,我通过以下命令更新了 ruby-build
cd ~/.rbenv/plugins/ruby-build
git pull
(I'm using OS X 10.9.4 MacBook Air)
(我使用的是 OS X 10.9.4 MacBook Air)
回答by James Gan
This happened to me today. "rbenv install -l' displays outdated list while "ruby-build --definitions" returns the correct list. The problem is fixed by executing following command:
这件事今天发生在我身上。“rbenv install -l”显示过时的列表,而“ruby-build --definitions”返回正确的列表。通过执行以下命令修复了问题:
rm -Rf ~/.rbenv/plugins/ruby-build
It seems there is an outdated version of ruby-build under ~/.rbenv/plugins. Not sure when it got generated.
似乎 ~/.rbenv/plugins 下有一个过时的 ruby-build 版本。不知道什么时候生成的。
回答by AmitF
This linkgives a good explanation of the two available options.
此链接很好地解释了两个可用选项。
If you installed rbenv from the git repository:
$ cd ~/.rbenv/plugins/ruby-build
$ git pull
如果您从 git 存储库安装了 rbenv:
$ cd ~/.rbenv/plugins/ruby-build
$ git pull
If you used Homebrew on OSX to install rbenv:
$ brew update
$ brew upgrade ruby-build
(Also running brew doctormight give you the exact solution.)
如果您在 OSX 上使用 Homebrew 来安装 rbenv:(
$ brew update
$ brew upgrade ruby-build
同时运行brew doctor可能会为您提供确切的解决方案。)
And if you have permission denied errors, this is my addition:
$ sudo chown -R $USER /usr/local; brew update
$ sudo chown -R $USER /usr/local; brew upgrade ruby-build
如果您有权限被拒绝的错误,这是我的补充:
$ sudo chown -R $USER /usr/local; brew update
$ sudo chown -R $USER /usr/local; brew upgrade ruby-build
Then you'll be able to install the recent versions.
$ rbenv install --list
$ rbenv install 2.1.2
然后您将能够安装最新版本。
$ rbenv install --list
$ rbenv install 2.1.2
回答by akowalz
The selected answer will work fine, but the issue may have simply been caused by homebrew not having an up-to-date formula for ruby-build at the time. As of this posting, the appropriate ruby-build formula has been put into the latest version of homebrew. So running:
选定的答案将正常工作,但问题可能只是由于自制软件当时没有最新的 ruby-build 公式造成的。截至本文发布时,适当的 ruby-build 公式已被放入最新版本的自制软件中。所以运行:
$ brew update
$ brew update
should get you version needed to get the latest ruby. Then, running rbenv install --listagain should list 2.1.2 (and others).
应该为您提供获取最新 ruby 所需的版本。然后,rbenv install --list再次运行应该列出 2.1.2(和其他)。
So if anyone sees this later on, hopefully you can avoid having to maintain the individual repositories if you'd rather use homebrew for package management.
因此,如果稍后有人看到这一点,如果您更愿意使用自制软件进行包管理,希望您可以避免维护各个存储库。
回答by Ismael Abreu
I've just updated ruby-build and ruby-install to latest versions and both have the latest ruby 2.1.2
我刚刚将 ruby-build 和 ruby-install 更新为最新版本,并且都具有最新的 ruby 2.1.2
Probably rbenv doing something nasty.
可能 rbenv 做了一些令人讨厌的事情。
回答by Salma Gomaa
cd /home/[user]/.rbenv/plugins/ruby-build && git pull && cd -
cd /home/[user]/.rbenv/plugins/ruby-build && git pull && cd -
Don't forget to replace [user] with your user
不要忘记将 [user] 替换为您的用户
回答by Andy D
Following all the above, on OSX 10.11 it still wouldn't list the latest versions. What I did below worked for me- I removed the dir, re-installed from brew then I had to link in brew like this:
根据上述所有内容,在 OSX 10.11 上,它仍然不会列出最新版本。我在下面所做的对我有用 - 我删除了目录,从 brew 重新安装然后我不得不像这样在 brew 中链接:
$ brew uninstall ruby-build --force
$ rm -Rf ~/.rbenv/plugins/ruby-build
and then
进而
$ brew install ruby-build
$ brew link --overwrite ruby-build
and then I saw the most recent versions to build.
然后我看到了要构建的最新版本。

