Saturday, October 27, 2012

Ruby Rails App on Heroku with PostgreSQL
Best free host for Ruby Rails

After cmd $ heroku create

Heroku provides you a PostgreSQL hence so it has to changed from SQLite before deploying it to Heroku. Follow manual given on, and after $ heroku create, do some changes in file as mention below

  1. Login to dashboard and goto newly created app.
  2. Check if Addon Heroku Postgres Dev :: Teal is added if not add it manually.
  3. Login to and under the respective app see the connection details of database.

Change in files

Change config/database.yml for production.
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000
#Details from
  adapter: postgresql
  encoding: utf8
  reconnect: false
  database: [Replace with database_name]
  pool: 5
  username:[Replace with username]
  password: [Replace with password]
  host: [Replace with host]

Change Gemfile for production.
group :development, :test do
   gem 'sqlite3'

group :production do
#Specially for heroku server
  gem 'rb'

Please comment for any related problem..

No comments:

Post a Comment