Skip to content

Instantly share code, notes, and snippets.

@ghostropic
Forked from catm705/gist:10171658
Created May 15, 2014 17:02
Show Gist options
  • Save ghostropic/01290779c7a0557ed682 to your computer and use it in GitHub Desktop.
Save ghostropic/01290779c7a0557ed682 to your computer and use it in GitHub Desktop.
--- HEROKU STEPS to SET UP: ---
(Make sure you're all pushed/pulled on master before doing anything heroku)
1. git init
2. git add -A
3. git commit -m “blah, blah”
4. heroku create
5. To add heroku ENV keys/variables → (If there are any).
Example: (See below "For adding multiple ENV keys")
heroku config:add BTCE_SECRET=ABCDEF BTCE_KEY=123456
6. git push heroku master
Put in gemfile:
- rails 12factor gem
- declare a ruby version → ruby -v then put ruby “2.1.0” in gemfile
gem 'rails_12factor', group: :production
ruby "2.1.0"
bundle install
____________________________________________________________________
Adding to the Database (heroku includes rake db:create so just do below):
- heroku run rake db:migrate
____________________________________________________________________
append .erb to files that need assets - ONLY style.css.erb
____________________________________________________________________
--- TO GET ASSETS/IMAGES TO SHOW UP ------
In production.rb file -> Must reset these:
1.) config.serve_static_assets = true
config.assets.compile = true
2.) rake assets:precompile (MUST DO THIS IF YOU WANT THE IMAGES TO LOAD UP!!!) !!!!
____________________________________________________________________
--- MISC ---
--> rake assets:clean (Reverse of precompile - it deletes things.)
git commit -m “precompiling in production”
Seeding the Database:
heroku run rake db:seed
DEBUGGING:
heroku logs
RENAMING APP ON HEROKU:
- You have to change the name in your .git/config file too - if you change the name in Heroku's Dashboard-Settings!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment