[英]Upgraded rbenv and still can't install ruby 2.4.0
I am trying to install ruby 2.4.0 using rbenv. 我正在尝试使用rbenv安装ruby 2.4.0。
I am using homebrew. 我正在使用自制软件。
When I tried the following command: 当我尝试以下命令时:
rbenv install ruby 2.4.0
I get the following: 我得到以下内容:
ruby-build: definition not found: 2.4.0
The following versions contain `2.4.0' in the name:
2.4.0-dev
2.4.0-preview1
rbx-2.4.0
See all available versions with `rbenv install --list'.
If the version you need is missing, try upgrading ruby-build:
brew update && brew upgrade ruby-build
I performed the brew update and brew upgrade ruby-build commands and I still get the same message that ruby-build definition 2.4.0 not found. 我执行了brew更新和brew升级ruby-build命令,但仍然收到相同的消息,即未找到ruby-build定义2.4.0。
How can I install ruby 2.4.0 and fix this problem? 如何安装ruby 2.4.0并解决此问题?
I found that I had to do the following: 我发现我必须执行以下操作:
brew reinstall ruby-build --HEAD
then I was able to install ruby 2.4.0 using: 然后我能够使用以下命令安装ruby 2.4.0:
rbenv install 2.4.0
I'm guessing that brew upgrade ruby-build --HEAD did not update the latest ruby installations available. 我猜想brew升级ruby-build --HEAD没有更新可用的最新ruby安装。
Start by checking Ruby 's version through: 首先通过以下方法检查Ruby的版本:
ruby -v
If it's not the version you need, make sure you download it from their Official Website . 如果不是您需要的版本,请确保从其官方网站下载。
Then, if you already have Homebrew installed, you can try the following command: 然后,如果您已经安装了Homebrew ,则可以尝试以下命令:
brew install ruby
Otherwise, you can install Homebrew first through this command: 否则,您可以先通过以下命令安装Homebrew :
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.