/ Ruby on Rails

Rails and vendor bundle

This is the process that I use to setup a new Ruby on Rails site with vendor bundle.

First lets make a new directory where the project will reside.

mkdir new-project-name

cd into the new directory.

Lets create the Gemfile.

echo "source 'https://rubygems.org'" >> Gemfile

And add the rails gem to the Gemfile.

echo "gem 'rails', '5.0.2'" >> Gemfile

Next we will install the rails gems in our project vendor/bundle
directory.

bundle install --path vendor/bundle

Now we can create our rails project.

bundle exec rails new .

You will get a prompt to overwrite the Gemfile. Type Y to allow the overwrite.

Last step is to add /vendor/bundle in our project .gitignore file.