Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mike1011/50c0209c4183302e71735197977b64be to your computer and use it in GitHub Desktop.
Save mike1011/50c0209c4183302e71735197977b64be to your computer and use it in GitHub Desktop.
RVM Workflow for creating a new Rails Project with Postgres, ready for Heroku
#Make sure heroku toolbelt and rvm are installed
#heroku toolbelt available to download on their site, rvm available via curl
\curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm use "2.1.1"
rvm use --create 2.1.1@project
gem install rails
#if using postgres (good for heroku) pass argument to 'rails new'
rails new project --database=postgresql
cd project
rvm --rvmrc 2.1.1@project
#change username to your postgres username in database.yml (this is usually the same name you login to your computer with)
#create the db
rake db:create
#start the server to check things out
rails s
#add ruby version to gemfile
ruby "2.1.1"
#add rails_12factor to gemfile for Heroku
gem 'rails_12factor'
#initiate project for git
git init
heroku apps:create project
#push to heroku
git push heroku master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment