With RVM installed, I like to maintain a gemset called new_projects. This has whatever rails version I want to be creating new projects with.
$ rvm 1.9.3@new_projects --verbose --create
$ gem install rails
$ gem install rails
$ rails new [newapp] -T -d postgresql --skip-bundle
$ echo "rvm 1.9.3@[newapp] --verbose --create" > [newapp]/.rvmrc
Update the gemfile to include the following (some will already be there, these are to copy/paste after the included comment) TODO: update for ruby debugger
# Deploy with Capistrano
gem 'capistrano'
gem 'devise'
gem 'haml-rails'
gem 'html5-rails'
gem 'inherited_resources'
group :development, :test do
#gem 'ruby-debug19', :require => 'ruby-debug'
gem 'rspec-rails'
gem 'database_cleaner'
gem 'factory_girl_rails'
gem 'capybara'
gem 'pry'
end
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'compass-rails'
gem 'compass-h5bp'
gem 'uglifier'
end
Remove the role info from config/database.yml and
$ rake db:create:all
$ rails generate rspec:install
$ rails generate devise:install
$ rails generate html5:install
Devise install will give you further instructions to follow.
You will need factories in spec/factories.rb
You willll need to make sure rspec can get at the devise helpers
edit spec/support/devise.rb to include:
RSpec.configure do |config|
config.include Devise::TestHelpers, :type => :controller
end
You will need to make the capybara DSL available for rspec. Make sure spec/spec_helper includes the following require calls:
require 'capybara/rspec'
require 'capybara/rails'