You want username
, not user
.
rails 3.1: postgres: why does db:create ignore my database.yml file?
-
27-11-2021 - |
Domanda
Here's my database.yml entry:
development:
adapter: postgresql
encoding: unicode
database: hi5fit_development
user: postgres
password: postgres
pool: 5
Here's my command-line:
rake db:create
Here's the error I get:
db/test.sqlite3 already exists
FATAL: password authentication failed for user "Eric"
/Users/Eric/.rvm/gems/ruby-1.9.3-p286@rails-31/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1076:in `initialize'
/Users/Eric/.rvm/gems/ruby-1.9.3-p286@rails-31/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1076:in `new'
... Many lines left out
This has happened on two different machines, one running Postgres 8.4 on OSX 10.5, the other Postgres 9.2 on OSX 10.6, both with Ruby 1.9.3 and Rails 3.1, so I'm most likely making a systematic error, and not running into a one-time glitch. Why is rake trying to use my login name and not the database name provided in config/database.yml
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow