RoRの構築方法

.zshrcに次のalias, functionを作っておく

alias b='bundle exec'
alias b-install-local='rbenv exec bundle install --path=vendor/bundle && rbenv rehash'
alias b-rails='bundle exec rails'
function b-rails-new {
  bundle exec rails new $1 --skip-bundle
}
alias b-rake='bundle exec rake'

Gemfile

$ bundle init
source "https://rubygems.org"

gem "rails"

インストール

$ b-install-local

railsプロジェクト作成

$ b-rails-new プロジェクト名

railsプロジェクトセットアップ

$ cd プロジェクト名
$ b-install-local

サーバー起動

$ b-rails s