-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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