LoginSignup
23
23

More than 5 years have passed since last update.

Ruby 2.1.0 install for Mac OSX

Last updated at Posted at 2014-01-31

はじめに

  • brewを使って、rbenvをインストール
  • rbenvでversion管理
  • rbenvでrubyインストール

環境

  • MacOSX 10.7.5
  • Homebrew 0.9.5
  • Ruby 2.1.0
  • Command Line Tools for Xcode(ruby install時に必要)

手順

1. Homebrewがなければインストールしておく

  • brewでインストールされるソフトの保存先作成
ディレクトリ作成
$ sudo mkdir /usr/local/bin/
  • インストール
    • このタイミングではdefaultで入っているrubyを使う
Homebrewインストール
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • パスを通す
bash_profile
$vim ~/.bash_profile
export PATH=/usr/local/bin:$PATH

$source ~/.bash_profile
  • Homebrewをupdateする
update
$ brew update

2. ruby-buildのインストール

rbenv
$ brew install rbenv
$ brew install ruby-build
$ brew install rbenv-gemset
$ brew install rbenv-gem-rehash

3. ruby2.1.0 インストール

  • インストール可能リスト確認
rbenv
$ rbenv install -l | grep 2.1.0
  • ruby 2.1.0インストール
install
$ rbenv install 2.1.0
  • 2.1.0をデフォルトで使うようにする
global
$ rbenv global 2.1.0
$ ruby -v
  • rubyのパスを通す
rehash
$ rbenv rehash
23
23
2

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
23
23