Noob here trying to work through M. Hartl's Ruby on Rails Tutorial. Attempted the advanced exercise #3.5.3 to change the database adapter from sqlite3 to PostgreSQL. Now I'm getting all sorts of errors. I would like to continue this struggle with the following advice: How do I find and examine my pg-hba.conf? The only thing I can turn up is "pg_hba.conf.sample" in usr/share/postgresql/9.1 and an empty file! called pg_hba.conf at /etc/postgresql/9.1/main that I think I created myself while thrashing about. Any help? Ideas? Did I delete it? Can it be rebuilt?
Asked
Active
Viewed 133 times
0

sevenseacat
- 24,699
- 6
- 63
- 88

penny
- 1
- 1
-
Are you on linux or osx? How did you install postgres? – carols10cents Sep 17 '13 at 02:40
-
I'm running Linux Mint 13. Hmmmm how did I install postgres? Lemme get back on that. That was lost week. – penny Sep 17 '13 at 02:54
-
Going back into my terminal entries, here's what I tried: 1) heroku addons:add heroku-postgresql:dev That generated an error. So: 2) heroku addons:docs heroku-postgresql Then: 3) heroku addons:add pgbackups Then: 4) sudo apt-get install postgresql-client-common Which was a mistake. So 5) sudo apt-get install libpq-dev That looks like it has a typo in it (should be libpg-dev?) Banging away: 6) sudo apt-get install postgresql and I have been googling errors ever since! – penny Sep 17 '13 at 03:11
-
No, `libpq-dev` is the right package name for PostgreSQL headers. – sevenseacat Nov 16 '13 at 06:51
1 Answers
0
You shouldn't need to modify anything in your pg_hba.conf to get your Rails app connecting to your locally installed PostgreSQL. You will need to configure the host
as being localhost
in your database.yml file, but that's about it.
Running locate pg_hba.conf
will tell you that the file you found in /etc/postgresql/9.1/main
is indeed the correct one for your install (I have the same file on my system). This is provided by the postgres-9.1
package.

sevenseacat
- 24,699
- 6
- 63
- 88