LoginSignup
4
5

More than 5 years have passed since last update.

macにhomebrewからrbenv ruby rails導入

Posted at

すでにちまたにでまわってますが、せっかくなので。

Mac OS X 10.9

home brewを最新にする

~ $ brew update
Updated Homebrew from a0b1aab2 to 51a9003a.

rbenv のインストール

~ $ brew install rbenv
==> Downloading https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz
######################################################################## 100.0%
==> Caveats
To use Homebrew's directories rather than ~/.rbenv add to your profile:
  export RBENV_ROOT=/usr/local/var/rbenv

To enable shims and autocompletion add to your profile:
  if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
==> Summary
?  /usr/local/Cellar/rbenv/0.4.0: 31 files, 152K, built in 5 seconds

messageに出ていた設定実施

~ $ echo 'export RBENV_ROOT=/usr/local/var/rbenv' >> ~/.bash_profile 
~ $ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi'>>~/.bash_profile

bashファイルの反映

~ $ source ~/.bash_profile 

rubyのインストール

~ $ rbenv install 2.1.1
~ $ rbenv rehash

rubyをどのユーザーでも使えるようにする

macでは不要かもです

~ $ rbenv global 2.1.1
~ $ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]

railsインストール

結構時間かかります。 verbose オプションつけたほうが進捗わかるかもです。未確認。

~ $ gem install rails
~ $ rbenv rehash
4
5
0

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
5