0

I have tried everything I have read on the internet but cannot seem to get it to work. I am trying to set it up on a new project. Here is my database.yml file:

development:
adapter: postgresql
encoding: unicode
database: timetracker_development
pool: 5
username: postgres
password:
host: localhost

test:
adapter: postgresql
encoding: unicode
database: timetracker_test
pool: 5
username: postgres
password:
host: localhost

production:
adapter: postgresql
encoding: unicode
database: timetracker_production
pool: 5
username: timetracker
password:

And the error i get on my web page:

'postgresql' database is not configured. Available: ["development", "adapter", "encoding", "database", "pool", "username", "password", "host", "test", "production"]

I installed postgress via brew and then did the init command and when I type the start command all it says is "server starting". Does this mean it did or didn't start? Anyone know how I can get this to work?

3
  • What is this database.yml, and what is it for? I have used postgresql for 15 years, and never had any such database.yml on my computer. Commented May 29, 2014 at 11:18
  • @AnttiHaapala This is the file in my rails project, probably should have mentioned that. Commented May 29, 2014 at 11:25
  • 1
    I think you have indented your database.yml wrong. Commented May 29, 2014 at 11:38

2 Answers 2

1

Indenting is significant in YAML.

blah:
blah2: 1

means a different thing to:

blah:
    blah2: 1
Sign up to request clarification or add additional context in comments.

Comments

1

Here is how your database.yml should look like:

development:
  adapter: postgresql
  encoding: unicode
  database: timetracker_development
  pool: 5
  username: postgres
  password:
  host: localhost

test:
  adapter: postgresql
  encoding: unicode
  database: timetracker_test
  pool: 5
  username: postgres
  password:
  host: localhost

production:
  adapter: postgresql
  encoding: unicode
  database: timetracker_production
  pool: 5
  username: timetracker
  password:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.