2020-1-16
macOS Mojave(10.14.6)
Homebrewでインストールする。ruby-buildも一緒にインストールされる。
$ brew update
$ brew install rbenv
PATHに以下を追加
~/.rbenv/shims
~/.rbenv/bin
export CC=/usr/bin/gcc
eval "$(rbenv init -)"
$ brew link readline --force
$ RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl@1.1)" CONFIGURE_OPTS="--disable-install-doc --disable-install-rdoc --disable-install-capi" rbenv install <version>
$ rbenv rehash
$ gem update --system --no-document
$ gem update --no-document
$ gem install bundler
ruby
のバージョン一覧を更新したい場合は ruby-build
で更新する
$ brew upgrade ruby-build
インストール可能なバージョン一覧の確認
$ rbenv install -l
Available versions:
1.8.5-p113
1.8.5-p114
1.8.5-p115
1.8.5-p231
1.8.5-p52
1.8.6-p110
(...)