LoginSignup
4

More than 5 years have passed since last update.

MacのRubyのバージョン古い

Posted at

MacのRubyのバージョンが古かったので更新します。

前提条件

  • MacOSSierra
  • Xcode導入済み
  • MacPortが入っていない
  • rvmが入っていない

インストール

xcode-select --install
  • インストールボタンを押す
  • Xcodeのコマンドラインツールのダウンロード&インストール
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Homebrewのダウンロード
  • パスワードとか(y/n)とか求められたら、どんどん入力
brew doctor
  • "Your system is ready to brew."と出ることを願う!
brew update
brew -v
  • Homebrew X.X.X (git revision XXXX; last commit XXXX-XX-XX) Homebrew/homebrew-core (git revision XXXX; last commit XXXX-XX-XX) みたいなことが出てくることを確認
brew install rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
brew install ruby-build
brew install rbenv-gemset
brew install rbenv-gem-rehash
  • パスワード、(y,n)とか求められたら、じゃんじゃん入力。

ターミナルの再起動

rbenv install 2.3.1
rbenv global 2.3.1

ターミナルの再起動

ruby --version

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4