エラー&対応方法メモ:Ruby / Ruby on Rails
目的
- エラーが出た場合の対応策を記録することで、同じエラーに出会った時の対応効率をあげる
rbenv install
でエラー
$ rbenv install 2.1.10 ruby-build: use openssl from homebrew Downloading ruby-2.1.10.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.10.tar.bz2 Installing ruby-2.1.10... WARNING: ruby-2.1.10 is past its end of life and is now unsupported. It no longer receives bug fixes or critical security updates. BUILD FAILED (OS X 10.13.6 using ruby-build 20180224)
ruby-buildでコケてるっぽい?他のバージョンでも試す。
せっかくだから最新安定版の2.5.1で。
$ rbenv install 2.5.1 ruby-build: definition not found: 2.5.1 The following versions contain `2.5.1' in the name: rbx-2.5.1 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
rbenvにそのバージョンが存在しないよ、的な。
brew update
するbrew upgrade ruby-build
する
$ brew upgrade ruby-build ==> Upgrading 1 outdated package, with result: ruby-build 20180224 -> 20180618 ==> Upgrading ruby-build ==> Installing dependencies for ruby-build: openssl ==> Installing ruby-build dependency: openssl xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Error: Failure while executing; `git config --local --replace-all homebrew.private true` exited with 1.
今度はxcrun
が見つからない、的な
- Xcodeをインストール(インストール済みだったはずだけどなぁ...)
- 無事にインストール完了
改めてrbenv install
rbenv install 2.1.10
rbenv install 2.5.1
- それぞれ無事完了