Skip to content

Instantly share code, notes, and snippets.

@mrilikecoding
Last active March 10, 2019 19:19
Show Gist options
  • Save mrilikecoding/9520502 to your computer and use it in GitHub Desktop.
Save mrilikecoding/9520502 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