rbenvでRubyの最新のバージョンに対応する


問題

% rbenv install 2.1.7

出力結果

ruby-build: definition not found: 2.1.7

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

解決

$ brew update && brew upgrade ruby-build

出力結果

Downloading ruby-2.1.7.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/f59c1596ac39cc7e60126e7d3698c19f482f04060674fdfe0124e1752ba6dd81
Installing ruby-2.1.7...
Installed ruby-2.1.7 to /Users/innova/.rbenv/versions/2.1.7

確認

$ rbenv versions

出力結果

  2.1.7

bundle更新

bundlerはrubyのバージョンごとに管理されているため、bundlerも更新する

以下のエラーがでてしまう

$ bundle install

出力結果

rbenv: bundle: command not found

The `bundle' command exists in these Ruby versions:
  2.0.0-p643
  2.1.5
  2.1.6
  2.2.2

解決

$ gem install bundler

出力結果

Fetching: bundler-1.10.6.gem (100%)
Successfully installed bundler-1.10.6
Parsing documentation for bundler-1.10.6
Installing ri documentation for bundler-1.10.6
Done installing documentation for bundler after 5 seconds
1 gem installed