gem install rails bundler
rails new my_app -T --skip-bundle
Put this in the Gemfile.
gem 'haml-rails'
gem 'simple_form'
group :development, :test do
gem 'thin'
gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git"
gem "rspec", :git => "git://github.com/rspec/rspec.git"
gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git"
gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git"
gem 'rspec-instafail'
gem 'cucumber-rails', :require => false
gem 'webrat'
gem 'capybara'
gem 'factory_girl_rails'
gem 'database_cleaner'
gem 'rb-fsevent'
gem 'growl'
gem 'rb-inotify', '~> 0.8.8'
gem 'guard-rails'
gem 'guard-bundler'
gem 'guard-migrate'
gem 'guard-spork'
gem 'guard-rspec'
gem 'guard-cucumber'
gem 'pry-rails'
end
I live on edge of rspec because cucumber-rails had a side effect to rspec gem at this moment. I could not run rake db:migrate.
bundle install --path vendor
Use this for all subsequent ````bundle install``` commands. Why? http://ryan.mcgeary.org/2011/02/09/vendor-everything-still-applies/
In your config/application.rb
, put this:
config.generators do |g|
g.test_framework :rspec, :view_specs => false, :webrat => true
end
rails g rspec:install
rails g cucumber:install --spork
bundle exec spork --bootstrap
Then edit spec/spec_helper.rb
and move everything into the prefork
section. The prefork
section will be called when every rspec runs.
Edit spec/spec_helper.rb
.
Put this in the prefork
section:
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
Put this in the each_run
section:
DatabaseCleaner.clean
Comment out the config.fixture_path
line in spec/spec_helper.rb
...the comment above implies it shouldn't be used if we're not using ActiveRecord fixtures.
echo '--colour
--drb
--require rspec/instafail
--format RSpec::Instafail' > .rspec
The --drb
is needed for spork and --colour
is for color, because it's pretty.
rails g simple_form:install --bootstrap
wget http://twitter.github.com/bootstrap/assets/bootstrap.zip
unzip bootstrap.zip
mv bootstrap/css/* app/assets/stylesheets/
mv bootstrap/js/* app/assets/javascripts/
mv bootstrap/img/* app/assets/images/
rm -r bootstrap bootstrap.zip
Now rails c
will startup using pry.
You can also add bindings.pry
anyplace and your app will stop there with a pry prompt until you exit
it.
See Also:
Run this commands for bundler, migrate, rspec spork:
bundle exec guard init
You may have to monkey withy our Guardfile
some but the order should be right. Spork must be started before rspec.
git init .
git add .
git commit -a -m 'initial commit'
rails g scaffold blog title:string article:string
rake db:migrate
bundle exec guard