Ruby

rbenvでrubyをインストールしようとしたらエラーになった

More than 1 year has passed since last update.


環境

macOS Sierra (10.12.1)


rbenv installでエラーに

エラーログは次の通り。

$ rbenv install 2.3.3

Downloading ruby-2.3.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2
Installing ruby-2.3.3...

BUILD FAILED (OS X 10.12.1 using ruby-build 20161121)

Inspect or clean up the working tree at /var/folders/6v/qz5j7l351rn85l17gz3v0c6r0000gn/T/ruby-build.20161126183610.19308
Results logged to /var/folders/6v/qz5j7l351rn85l17gz3v0c6r0000gn/T/ruby-build.20161126183610.19308.log

Last 10 log lines:
/var/folders/6v/qz5j7l351rn85l17gz3v0c6r0000gn/T/ruby-build.20161126183610.19308/ruby-2.3.3 /var/folders/6v/qz5j7l351rn85l17gz3v0c6r0000gn/T/ruby-build.20161126183610.19308 ~
checking for ruby... /usr/local/bin/ruby
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin16.1.0
checking host system type... x86_64-apple-darwin16.1.0
checking target system type... x86_64-apple-darwin16.1.0
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
configure: error: clang version 3.0 or later is required
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


xcode-selectをインストールしたらOK

xcode-selectをインストールしたらインストールしたらrbenv installもできるようになった。

$ xcode-select --install

$ rbenv install 2.3.3