Getting Rails and Postgres configured on Win8

Heroku promises minimal config for rails devs, but out of the box, it has taken a bit of research to get it working right with Win8

 especially since rails seems to have mysql as the default... weird choice imho.

 Beyond following heroku instructions there are a couple other steps.

 Firstly, I can recommend getting aptana set up, it has a default rails project that has most things setup.

 next in postgres you have to set a role for your project to use. my role is called example and i setup it with just about all privileges on to get things going.

 In Aptana, create a new Rails project.

from the console terminal that aptana creates install a couple gems

gem install pg 
gem install activerecord-postgresql-adapter 

in Aptana in your project make the following changes to config/database.yml 

Remove the setting for the sqlite3 and replace the settings for your postgres db.
( example needs to be replaced with your settings. )

 adapter: postgresql 
 database: example_db 
 username:example 
 password:example 
 host:localhost 
 encoding:UTF8

 then in the Gemfile in your project remove gem 'sqlite3' and replace with gem 'pg'

 lastly in the command line console of Apatana, type rake db:create

hopefully thats it

0 comments: