idisposable.net: a blog about web 2.0, search, collaboration, Ruby on Rails, Microsoft, Google, and other fun stuff

RubyQuest 2007: Driving myself crazy so you don’t have to. Tutorial #1 Running Ruby and postgreSQL on Windows

Ok folks, this drove me absolutely insane for a few days until I figured it out.



I want to learn Ruby. You can read my previous posts to see why. I want to use postgreSQL, not mySql. I want to do it on Windows and then eventually deploy on Linux.



So - I made it pretty far by following the basic steps from the Download Ruby on Rails page. I was able to get Ruby on Rails running and create my “Hello World” app. Ready to move on.



I installed postgreSQL 8.2. I found lots of conflicting information on how to actually use postgresql with Ruby. Some stuff about postgres-pr, not much about how to actually use it. Couldn’t get it to work. I found this enhanced postgres driver for windows. Couldn’t get it to work. I was trying to use it, from my database.yml file, like this:




development:

adapter: postgres




Big mistake. I scratched my head, googled the entire internet and back, and couldn’t figure out why ruby kept on barfing when I tried to create a model based on this database. Here is the error I was getting:


`establish_connection’: database configuration specifies nonexistent postgres adapter (ActiveRecord::AdapterNotFound)


Yikes. That is an ugly error huh? Not until I came upon the wonder ruby-form search page did I find the simple answer to my quest.



instead of using postgres as my adapter, use postgresql.



holy crap! is that it ?!?!?! Either I am an idiot or it is tough to find simple configuration instructions for common Ruby stuff out there. So here it is folks — if you want to use Ruby on Postgresql on Windows, make sure you get the right drivers, install postgresql first, and use




adapter: postgresql


in your database.yml








Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*