Skip to content

Instantly share code, notes, and snippets.

@STAR-ZERO
Last active December 9, 2015 19:09
Show Gist options
  • Select an option

  • Save STAR-ZERO/4315203 to your computer and use it in GitHub Desktop.

Select an option

Save STAR-ZERO/4315203 to your computer and use it in GitHub Desktop.
Railsプロジェクト作成手順

プロジェクトディレクトリ作成

$ mkdir newapp
$ cd newapp

Gemfile作成

$ bundle init

編集

$ vim Gemfile

下記を追加

source 'https://rubygems.org'
gem 'rails', '4.2.3'

gemをインストール

$ bundle install --path=vendor/bundle

Railsプロジェクト作成

DBはMySQL、test::unitを組み込まない、bundle isntallはあとで
Gemfileの上書き確認が出るので「Y」

$ bundle exec rails new . -T -d mysql --skip-bundle

RSpecをGemfileに追加

group :test, :development do
  gem 'rspec-rails'
  gem 'spring-commands-rspec'
end

gemをインストール

$ bundle install

Spring初期設定

$ bundle exec spring binstub --all

RSpecディレクトリ作成

$ bin/rails g rspec:install

.gitignoreにvendor/bundleを追加

/vendor/bundle

rails、rake, rspecコマンド

Springを有効にするため、すべてbin/をつけて実行する

$ bin/rails
$ bin/rake
$ bin/rspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment