Rails and PostgreSQL: Success!

As I mentioned earlier, I was having trouble getting Rails and
PostgreSQL running on Fedora Core 4. I was thinking that maybe I
had something wrong with my configuration, or maybe SELinux was getting
in the way. Nope. I was missing the PostgreSQL database driver gem. To
save myself and hopefully somebody else the pain, I am going to document
my setup.

​1. Install Ruby. (#yum install ruby ruby-libs ruby-devel)

  1. Install PostgreSQL. (#yum install postgresql-server)
  2. Run initdb.
  3. Edit pg_hba.conf and enable TCP/IP connections.
  4. Download and install RubyGems.
  5. Install Rails. (#gem install rails –remote)
  6. Install the Ruby PostgreSQL driver. (#gem install postgres

–remote)

  1. Generate a Rails project. ($rails )
  2. Edit config/database.yml and change the adapter to “postgres”.

Voila. Rails should now be up and running using PostgreSQL as the
database.

Tags: Ruby Rails PostgreSQL Fedora