Command line arguments in this file are appended to the rails new command. To see what options are available, take a look at the output from rails new --help. Save this file in your home directory.


This file lets us completely customize our rails app, right down to which gems to add and which commands to run. See the RailsGuides for details on all that you can do.

An example

The following files set up my new Rails apps the way I like ‘em: RSpec, Factory Girl, and Capybara for testing. Foundation for the front-end. Postgres on the back. Copy and customize to suit your needs.

# ~/.railsrc

# ~/rails_template.rb

gem_group :development, :test do
  gem "capybara"
  gem "factory_girl_rails"
  gem "rspec-rails", "~> 3.0"
  gem "pry-rails"
  gem "shoulda-matchers"

gem_group :test do
  gem "launchy", require: false
  gem "valid_attribute"

gem_group :production, :staging do
  gem "rails_12factor"

scss = <<-SCSS
@import "*";

run "echo '#{scss}' >> app/assets/stylesheets/application.scss"
run "rm app/assets/stylesheets/application.css"
run "rm README.rdoc"
run "echo '# #{@app_name.titleize}' >> README.md"

run("bundle install")


run "echo 'require \"capybara/rails\"' >> spec/rails_helper.rb"

git :init
git add: "."
git commit: "-a -m initial"