If a man speaks in a forest, and his wife's not there, is he still wrong?

Rails with Postgresql

My first attempts at using Rails with MySQL weren't all that successful - I'm not sure why. However, as I intend to use Postresql in the long run, I decided to install the Rails Postgresql adapter.

First, I installed the ruby-devel package (needed to build gems packages).

# yum install ruby-devel

Now instal the postgres driver for Rails:

# gem install postgres --remote

I then started to run through the tutorial on the RubyOnRails Wiki.

I created a Postgres database "rails_development" and a postgres user "rails"

I ran the script to create the "people" table.

Created a new Rails app called "WikiDemo" and made it available at http://rails.robinbowes.com

Modified config/database.yml to point to the newly created postgres database:

development:
  adapter: postgresql
  database: rails_development
  host: localhost
  username: rails
  password: secret

Created a new Controller:

# ./script/generate controller Friends list show new

Created a new Model:

# ./script/generate model Person

Edited the display code:

vi app/views/friends/show.rhtml

Edited the model:

vi app/controllers/friends_controller.rb

Browsed to the site to see if it worked:

http://rails.robinbowes.com/friends/show

Bah, it didn't!

Story Options

Rails with Postgresql | 2 comments
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Rails with Postgresql
ryuuguu Saturday, July 16 2005 @ 04:58 AM BST

I see you getting it working later. What were your error messages and how did you fix the problem.

Cheers,
A "still struglling to get postgresql with rail to work" programmer who really would apreciate the help.

 

Topics

  • Home
  • Misc (6/0)
  • Audio (5/0)
  • Linux (21/0)
  • Family (1/0)
  • Fishing Diary (1/0)
  • OpenSolaris (7/0)
  • Computing (11/0)
  • General News (7/0)
  • Chloe (1/0)
  • Emily (2/0)
  • Twins (5/0)
  • Classifieds (2/0)
  • GeekLog (2/0)
  • Project Management (1/0)
  • User Functions






    Lost your password?