Ruby on rails 从2.0.0更新ruby

Ruby on rails 从2.0.0更新ruby,ruby-on-rails,ruby,macos,Ruby On Rails,Ruby,Macos,如何为我的mac book air将ruby从2.0.0更新为最新版本?我尝试了大多数CLI教程,但也出现了一些错误,这些错误也不允许我下载rails。这是我尝试使用rbenv更新时遇到的错误: $ rbenv install 2.3.1 Downloading ruby-2.1.3.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.3.tar.bz2 Installing ruby-2.1.3... W

如何为我的mac book air将ruby从2.0.0更新为最新版本?我尝试了大多数CLI教程,但也出现了一些错误,这些错误也不允许我下载rails。这是我尝试使用rbenv更新时遇到的错误:

 $ rbenv install 2.3.1 
Downloading ruby-2.1.3.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.3.tar.bz2 Installing ruby-2.1.3...  
WARNING: ruby-2.1.3 is nearing its end of life. It only receives critical security updates, no bug fixes.
BUILD FAILED (OS X 10.11.6 using ruby-build 20160602)
Inspect or clean up the working tree at /var/folders/6h/xq5sgstd3ynfkc4qcp53m0dh0000gn/T/ruby-build.20160822200825.84956
Results logged to /var/folders/6h/xq5sgstd3ynfkc4qcp53m0dh0000gn/T/ruby-build.20160822200825.84956.log
Last 10 log lines: 
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [main.o] Error 2
make: *** Waiting for unfinished jobs....
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''    
/bin/sh: -c: line 1: syntax error: unexpected end of file Apple LLVM version 7.3.0 (clang-703.0.31) Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 
make: *** [dmydln.o] Error 2

你是说ruby 2.3.1吗?2.1.3有一个警告

我也建议使用自制的

brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

# Install Ruby
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
gem install bundler

更多信息:

在我的例子中,安装程序崩溃了,因为我最近重新安装了Xcode,但忘记安装命令工具

跑步后

sudo xcode-select --install

我使用
rbenv

成功安装了Ruby,这就是我所遵循的,在第一次安装rbenv 2.3.1时,我的错误就出现了。我认为阻碍我的是需要Ruby 2.2.2的主动支持