はじめに
下記のものを入れておく
- git
- rbenv
- ruby-build
- ruby
[参考] http://qiita.com/inouet@github/items/478f4228dbbcd442bfe8
1. gem のアップデート
$ gem update --system
2. bundler のインストール
$ gem install bundler --no-ri --no-rdoc
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
忘れずに
$ rbenv rehash
3. rails のインストール
$ mkdir ~/my_rails_app
$ cd ~/my_rails_app
$ bundle init
Gemfile ができる
Gemfile 編集
$ vim Gemfile
source "https://rubygems.org"
gem 'rails', '~> 4.0.0'
$ bundle install
3. 確認
$ rails -v
Rails 4.0.1
プロジェクト作ってみる
$ rails new test_app
いろいろファイルが作られる
WEBサーバ(WEBRic)を立ち上げて確認
$ cd test_app
$ rails server
JavaScript Runtime のエラーが出る場合は therubyracer を入れる。
Gemfile編集して
$ vim Gemfile
# gem 'therubyracer', platforms: :ruby <== このコメントを外す
インストール
$ bundle install
ブラウザでURLを叩いて Rails 画面が出ればOK