Guest User

Untitled

a guest
Jan 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. ### Install Rails 3.1 RC
  2.  
  3. ````gem install rails --pre````
  4.  
  5. ### generate new app, skipping Test::Unit file generation
  6.  
  7. ````rails new my_app -T````
  8.  
  9. ### Set up Gemfile
  10.  
  11. ````ruby
  12. # in Gemfile
  13.  
  14. gem 'haml'
  15. gem 'haml-rails', :group => :development
  16. gem 'devise'
  17. gem 'simple_form'
  18. # gem 'formtastic'
  19.  
  20. group :test do
  21. gem 'database_cleaner'
  22. gem 'rails3-generators' #mainly for factory_girl & simple_form at this point
  23. gem 'rspec-rails'
  24. gem 'factory_girl_rails'
  25. gem 'cucumber-rails'
  26. gem 'capybara'
  27.  
  28. end
  29. ````
  30.  
  31. ### Install our gems
  32.  
  33. ````
  34. bundle install
  35. ````
  36.  
  37.  
  38. ### Configure generators to use the gems we want, and skip view spec generation
  39.  
  40. ````ruby
  41. # in config/application.rb
  42.  
  43. config.generators do |g|
  44. g.test_framework :rspec, :views => false, :fixture => true
  45. g.fixture_replacement :factory_girl, :dir => 'spec/factories'
  46. g.form_builder :simple_form
  47. g.template_engine :haml
  48. end
  49. ````
  50.  
  51. ### turn on autoloading of lib directory and all its subdirectories
  52.  
  53. In Rails 3+, the lib directory is no longer autoloaded.
  54.  
  55. ````ruby
  56. # in config/application.rb
  57. config.autoload_paths += %W(#{config.root}/lib)
  58. config.autoload_paths += Dir["#{config.root}/lib/**/"]
  59. ````
  60.  
  61. ### run install tasks for our gems
  62.  
  63. ````
  64. rails g cucumber:install
  65. rails g rspec:install
  66. rails g simple_form:install
  67. rails g devise:install
  68. rails g devise User
  69. ````
Add Comment
Please, Sign In to add comment