Thursday, 5 January 2012

Creating a Rails Application from Scratch

  1. Navigate to base Rails applications folder and execute:
    • rails new newAppName -T
      • The -T prevents rails generating Test::Unit files - we'll use RSpec
  2. Copy/create three required files from a base application:
    • .autotest
    • .gitignore
    • Gemfile
  3. Install new gems with:
    • bundle install
  4. Generate files required by RSpec:
    • rails generate rspec:install
  5. Add switches to .rspec:
    • --colour
    • --drb
  6. Bootstrap Spork:
    • bundle exec spork --bootstrap
  7. Initialise the Git repository:
    • git init
    • git add .
    • git commit -m "Initial Commit"
  8. Update the application README contents, then change to use the markdown extension:
    • git mv README README.markdown
    • git commit -a -m "Improved the README"
Optional:
  1. Create remote repo - on GitHub, Unfuddle, etc. Push code to remote repo regularly.
  2. Deploy app to Heroku:
    • git push heroku master

No comments:

Post a Comment

Please leave a comment if you find this blog helpful or interesting! I'd love to hear from you!