1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mac(OS X 10.9.2)でRuby On Railsの環境構築

Last updated at Posted at 2014-06-12

XcodeとCommand Line Toolsをインストール

まず、XcodeとCommand Line Toolsをインストール。
XcodeはAppStoreから。Command Line Toolsは以下の方法でインストール。

Command Line Toolsインストール手順

1.メニューからXcode > Open Developer Tool > More Developer Tools。

2.Downloads for Apple Developerページが開くので、リストから”Command Line Tools(OS X Mavericks) for Xcode”をダウンロードしてインストール。

Homebrew(パッケージマネージャ)をインストール

続いて、Homebrewのインストール。
Homebrewについてはココを読んでください。

ターミナルを立ち上げて以下のコマンドを入力。

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

$ brew doctorと入力して、「Your system is ready to brew.」と表示さればOK。

Rubyのインストール

まずはターミナルで以下のコマンドを入力。

$ brew install rbenv ruby-build

続いて、以下のコマンドを入力し、プロファイルに eval "$(rbenv init -)" を追加する。

$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile

$ echo $PATHと入力して、Pathを確認。
以下のようになっていればOK。
/Users/****/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Pathが通ったら、ターミナルで以下のコマンドを入力すると、インストール可能なバージョンのリストが表示されます。

$ rbenv install -l

以下のコマンドを入力し、2.1.1をインストールします。

$ RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.1.1

インストールが完了したら、元々インストールされているRubyと切り替えます。以下のコマンドを入力。

$ rbenv global 2.1.1
$ rbenv rehash

$ ruby -vを入力して、バージョンを確認。

Railsをインストール

ターミナルで以下のコマンドを入力し、Railsをインストール。

$ gem install rails

インストールが完了したら$ rails -vと入力して確認。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?