Building new Rails apps

May 14, 2012

It doesn’t seem common for people to paste simple things out into the world. So I’ll have to make something to fix that…

But for now, these are the lines I’m using to build out new Rails apps using the same settings from a previous project.

rvm use 1.9.3-p0@EXISTING_PROJECT
rails new new_project_name_here -d mysql
rvm --create --rvmrc 1.9.3-p0@new_project_name_here

More to come!

EDIT:

To make a new non-Rails project using a specific version of ruby, create a gemset, and create a .ruby-version file all in one go:

mkdir project_name_here; cd project_name_here
rvm --ruby-version --create use 1.9.3@project_name_here

EDIT:

The previous entries weren’t actually starting from scratch though:

rvm use --create 1.9.3@project_name_here
gem install rails -v 3.2.13 --no-document
rails _3.2.13_ new project_name_here -d mysql
cd project_name_here
rvm --ruby-version use 1.9.3@project_name_here

And for good measure, ya might as well make a pages controller to go along with that:

rails g controller Pages

Oh, and don’t forget:

rake db:create db:migrate

James Hagerman

Written by James Hagerman

© 2026