Quantcast
Channel: just in ram
Viewing all articles
Browse latest Browse all 14

Rails new app workflow

0
0

These are the steps I take when creating a new Rails app, documented here for when I forget.

Create app

rails new <app_name>

cd <app_name>

git

git init

git add .

git commit –m ‘Initial commit’

Remember: Rails generates a .gitignore file for us.

rvm and gemsets

rvm gemset create <app_name>

echo ‘rvm use 1.9.2@<app_name>’ >> .rvmrc

echo ‘.rvmrc’ >> .gitignore

Creates a .rvmrc file in current directory that way when you cd into this directory rvm automatically switches to the correct version of ruby and the gemset we just created.

Change in and out of the directory to get rvm to kick in:

cd ..

cd <app_name>

Gemfile

Edit ./Gemfile and add the following lines.

gem ‘haml’

group :test do

    gem ‘rspec’

    gem ‘rspec-rails’

end

Then install and run bundler:

gem install bundler

bundle install

rspec

Generate the rspec files:

rails g rspec:install


Viewing all articles
Browse latest Browse all 14

Latest Images

Trending Articles





Latest Images