LoginSignup
11
11

More than 5 years have passed since last update.

MacにRubyをrbenv使って入れる。(Lion+homebrew版)

Posted at

homebrewは入っている前提。

rbenvとruby-buildのインストール

ruby-buildを実行する時にgccないと怒られるので先にインストール

↓のURLからGCC-10.7-v2.pkgをダウンロードしてインストール
https://github.com/kennethreitz/osx-gcc-installer/downloads

homebrew実行

brew install rbenv ruby-build

これでrbenvとruby-buildがインストールされる。

zshに設定を追加

echo 'eval "$(rbenv init -)"' >> .zprofile

その後、シェルを再起動する。
(zshrcに入れるのは間違いらしい)

Ruby 1.9.2-p320をインストール

事前にバージョンチェック

$ ruby --version                            
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]

インストール

rbenv install 1.9.2-p320

デフォルトに設定

rbenv global 1.9.2-p320

もう一回チェック!

$ ruby --version                            
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin11.4.2]

変わってるのを確認したら成功です!

11
11
1

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