Archive for 'Database Connection'

Having issues installing gem ‘pg’ (postgresql)?

If you run into the “Can’t find the ‘libpq-fe.h header” error, see below if you want to know how I solved the problem: I was able to solve the problem by executing the following before doing a ‘bundle install’:

Installing PostgreSQL on a mac (Lion)

Check to see if you mac already has an older version of PostgreSQL installed: postgres –version which postgres If you see anything, that means you already have an older version of postgres installed. Install PostgreSQL via Home Brew: brew install postgresql Somewhere in the output after PostgreSQL is installed you’ll see the version of your […]

Installing, Configuring and Troubleshooting PostgreSQL 9.0 in Rails 3 on OS X

The following may apply to other versions of PostgreSQL as well but I’m using version 9.0. I initially tried to install PostgreSQL via MacPorts but after running into issues I describe below, I ended up installing it via the Mac OS X package. If you want to skip issues I ran into with my macports […]

Creating a MySQL Database from Terminal or Command Line

The following assumes you have a successful installation of MySQL on OS X or Linux: Create MySQL Database To Test the Connection

Reusing database.yml Sections

In order to reuse database.yml sections for your database connection information, you can do the following in your database.yml file. Notice the use of &development which creates a tag which can be referenced later within your database.yml file. You can also do something like this, which assigns the &login tag which is later referenced within […]