LoginSignup
16
15

More than 5 years have passed since last update.

Macで「Ruby on Rails チュートリアル」環境構築メモ

Posted at

Ruby on Rails の勉強のための環境構築メモです。

これにそって、実施していきます。
Ruby on Rails チュートリアル

前提

  • gitがインストール済み
  • HomeBrewがインストール済み

インストールするバージョン

  • Ruby -> 2.1.1
  • Rails -> 4.0.5

インストール手順

RVMのインストール

curl -L https://get.rvm.io | bash -s stable
## 環境チェック。brewをインストール済みなら必要な物をインストールしてくれます。
rvm requirements

この作業は、30分程度かかる場合があります。途中で止まっているようにみえるかもしれませんが、気長に待ちましょう。

rvmでRubyのインストール

rvm list known
rvm install 2.1.1
ruby -v

gemでRailsのインストール

rvm gemset create rails40
rvm 2.1.1@rails40 default
gem install rails --version 4.0.5 --no-rdoc --no-ri
rails -v

railsアプリケーション作成

mkdir rails_projects
cd rails_projects
rails new first_app

Gemファイル編集

cd first_app
cp Gemfile Gemfile.org
vi Gemfile
diff Gemfile Gemfile.org
2d1
< ruby '2.1.1'
8,10c7
< group :development do
<   gem 'sqlite3','1.3.8'
< end
---
> gem 'sqlite3'
13c10
< gem 'sass-rails', '4.0.2'
---
> gem 'sass-rails', '~> 4.0.2'
16c13
< gem 'uglifier', '2.1.1'
---
> gem 'uglifier', '>= 1.3.0'
19c16
< gem 'coffee-rails', '4.0.1'
---
> gem 'coffee-rails', '~> 4.0.0'
25c22
< gem 'jquery-rails','3.0.4'
---
> gem 'jquery-rails'

依存関係更新

bundle update
bundle install

サーバー起動

rails server

一先ず起動できるところまで。

16
15
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
16
15