Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 15th, 2012  |  syntax: None  |  size: 1.49 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ### generate new app, skipping Test::Unit file generation
  2.  
  3. ````rails new my_app -T````
  4.  
  5. ### Set up Gemfile
  6. source 'http://rubygems.org'
  7.  
  8. gem 'rails', '3.1.0'
  9.  
  10. gem 'sqlite3'
  11. gem 'simple_form'
  12. gem 'thin'
  13. gem 'heroku'
  14. gem 'paperclip'
  15. gem 'activeadmin'
  16. gem 'devise'
  17. gem 'cancan'
  18.  
  19. # Gems used only for assets and not required
  20. # in production environments by default.
  21. group :assets do
  22.   gem 'sass-rails', "  ~> 3.1.0"
  23.   gem 'coffee-rails', "~> 3.1.0"
  24.   gem 'uglifier'
  25. end
  26.  
  27. gem 'jquery-rails'
  28.  
  29. group :test do
  30.   gem 'database_cleaner'
  31.   gem 'rails3-generators' #mainly for factory_girl & simple_form at this point
  32.   gem 'rspec-rails'
  33.   gem 'factory_girl_rails'
  34.   gem 'cucumber-rails'
  35.   gem 'capybara'
  36. end
  37.  
  38. group :development do
  39.   gem 'awesome_print', :require => 'ap'
  40. end
  41.  
  42. ````
  43. bundle install
  44. ````
  45.  
  46.  
  47. ### Configure generators to use the gems we want, and skip view spec generation
  48.  
  49. ````ruby
  50. # in config/application.rb
  51.  
  52. config.generators do |g|
  53.   g.test_framework :rspec, :views => false, :fixture => true
  54.   g.fixture_replacement :factory_girl, :dir => 'spec/factories'
  55.   g.form_builder :simple_form
  56. end
  57. ````
  58.  
  59. ### turn on autoloading of lib directory and all its subdirectories
  60.  
  61. In Rails 3+, the lib directory is no longer autoloaded.
  62.  
  63. ````ruby
  64. # in config/application.rb
  65. config.autoload_paths += %W(#{config.root}/lib)
  66. config.autoload_paths += Dir["#{config.root}/lib/**/"]
  67. ````
  68.  
  69. ### run install tasks for our gems
  70.  
  71. ````
  72. rails g cucumber:install
  73. rails g rspec:install
  74. rails g active_admin:install
  75. rails g simple_form:install
  76. ````