#Heroku Setup
This information can be found in more detail here: https://devcenter.heroku.com/articles/getting-started-with-rails3#prerequisites
###Prerequisites
- Ruby version 2.0.0
- Heroku Account
- Git repo set up
- Heroku Toolbelt installed on your locale machine: https://toolbelt.herokuapp.com/osx
$ heroku login
# Login with your heroku email and password.
# If it asks "Would you like to generate one? [Yn]". Enter "y".
##Rails 3
###Setting up PostgreSQL
#####New Rails Project
rails new myapp --database=postgresql
#####Excising Rails Project
- In your gemfile change
gem 'sqlite3'
togem 'pg'
. $ bundle install
- Change your config/database.yml to look something like this.
development:
adapter: postgresql
encoding: unicode
database: myapp_development
pool: 5
username: myapp
password:
test:
adapter: postgresql
encoding: unicode
database: myapp_test
pool: 5
username: myapp
password:
production:
adapter: postgresql
encoding: unicode
database: myapp_production
pool: 5
username: myapp
password:
- Switch the username and password.
###Setting Up Rails
- In your config/application.rb change this line of code.
config.assets.initialize_on_precompile = false
- In your gemfile add
ruby '2.0.0'
(This makes Heroku happy.)
###Setting Up Git
- Run.
$ git init
$ git add .
$ git commit -m "init"
- Create your heroku app. You can add a app name to the end of the command but it must be unique.
$ heroku create (optional name)
- Push your code to heroku
$ git push heroku master
- Visit your site and hope its not broken...
$ heroku open
- Run your migrations
$ heroku run rake db:migrate
- Restart Heroku
$ heroku restart
###Figaro SetUp:
If you are useing figaro you will need to run rake figaro:heroku
to tell heroku about your secert vaiables.