以下,Ruby on Rails自体をローカル環境にインストールし,railsプロジェクトのひな形をそのローカル環境に構築した際の覚え書き.
rbenvをインストール
利用したいrubyバージョンをインストール
$ rbenv install 2.1.5
グローバル環境にbundler
だけをインストール
$ gem install bundler
プロジェクトフォルダを作成
$ mkdir example
$ cd example
$ rbenv local 2.1.5
railsをローカル環境にインストール
下記の内容でGemfile
を作成
source "http://rubygems.org"
gem "rails", "4.1.8"
railsを./vendor/bundle
にインストール
$ bundle install --path vendor/bundle
プロジェクトのひな形を作成
$ bundle exec rails new .
このとき,Gemfileを上書きするか聞いてくるので上書きする.
$ bundle exec rails server
で正常に動作することを確認.