Skip to content

Instantly share code, notes, and snippets.

@briangershon
Last active August 29, 2015 14:14
Show Gist options
  • Save briangershon/07a869181495691c7577 to your computer and use it in GitHub Desktop.
Save briangershon/07a869181495691c7577 to your computer and use it in GitHub Desktop.
Deploying Rails 4.2 App on Heroku

My notes on creating a Rails 4.2 app for hosting on Heroku. With RSpec and Postgresql.

# Install RVM, Ruby and Bundler
...

# Install Rails
gem install rails --no-ri --no-rdoc

# Create new app without Test::Unit, and for Postgresql (for Heroku)
rails new MYAPP --skip-test-unit --database=postgresql

# update Gemfile with these gems
gem 'rails_12factor'    # for Heroku asset pipeline support, etc
gem 'sqlite3'           # add to :development, :test group
gem 'rspec-rails'       # add to :test group

bundle install
rails g rspec:install

# create heroku app
heroku apps:create MYAPP

# add heroku Postgresql database
heroku addons:add heroku-postgresql:hobby-dev
# for documentation: `heroku addons:docs heroku-postgresql`

# push to Heroku
git push heroku master

# rake db:migrate
heroku run rake db:migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment