1

When I try to run my sample Rails 4.0.1 app on my localhost:3000, I get this error:

PG:: ConnectionsBad FATAL: role "myapp" does not exist.

I'm running on Maverick OSX and using Ruby 2.0. I created my sample app exactly as https://devcenter.heroku.com/articles/getting-started-with-rails4 instructed, but when I tried '$ rails server' , I got the error above. I'm running the current Postgres. I attempted to change pg_hba.conf according to other stackoverflow advice, but so far it's still not working. I can run on my localhost with MySQL3, but cannot with Postgresql. I want to run Postgresql in Development, Test and Production as per Heroku's advice.

Ref: Rails: Deploying to Heroku, Many Problems, Repairing postgresql after upgrade to OSX Mavericks

Community
  • 1
  • 1
Matt
  • 811
  • 2
  • 11
  • 20
  • What does your `database.yml` look like? – Kevin Sylvestre Nov 25 '13 at 20:23
  • what's the output of `ps auxwww | grep postgres` – ksu Nov 25 '13 at 20:27
  • Here is my database.yml... development: adapter: postgresql encoding: unicode database: AAA_website_heroku_development pool: 5 username: AAA_website_heroku password: test: adapter: postgresql encoding: unicode database: AAA_website_heroku_test pool: 5 username: AAA_website_heroku password: production: adapter: postgresql encoding: unicode database: AAA_website_heroku_production pool: 5 username: AAA_website_heroku password: – Matt Nov 25 '13 at 20:29
  • Did you create the database? – fatfrog Nov 26 '13 at 02:50

2 Answers2

1

I think this is your problem:

username: AAA_website_heroku 

For the default install of PG, the username is the same username as your computer user account.

fatfrog
  • 2,118
  • 1
  • 23
  • 46
1

If you are using Postgresql database, you should specify a username and password for your databases. In your database.yml, I don't see your passwords. Try create a user in Postgresql and specify username and password of that user in database.yml and run again.

Thanh
  • 8,219
  • 5
  • 33
  • 56