rake db:setup 出现问题

rake db:setup 出现问题

我正在尝试使用 拉取 GitHub 文件rake db:setup,但每次都出现错误,无论我重新安装多少次PostgreSQL安装 postgresql或者检查 Rails。这是我收到的错误:

hifriend@ubuntu:~/refugerestrooms$ sudo -u root -H bundle exec \
  rake db:setup --trace
** Invoke db:setup (first_time)
** Invoke db:schema:load_if_ruby (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:create
fe_sendauth: no password supplied
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `initialize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `new'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `connect'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:542:in `initialize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:53:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:72:in `create'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:86:in `block in create_current'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:182:in `block in each_current_configuration'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:181:in `each'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:181:in `each_current_configuration'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:85:in `create_current'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:20:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.0.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"bathrooms_development", "pool"=>5, "host"=>"localhost", "username"=>"root", "password"=>nil}
fe_sendauth: no password supplied
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `initialize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `new'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `connect'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:542:in `initialize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:53:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:72:in `create'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:86:in `block in create_current'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:182:in `block in each_current_configuration'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:181:in `each'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:181:in `each_current_configuration'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:85:in `create_current'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:20:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.0.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"bathrooms_test", "pool"=>5, "host"=>"localhost"}
** Invoke environment (first_time)
** Execute environment
** Execute db:schema:load_if_ruby
** Invoke db:schema:load (first_time)
** Invoke environment 
** Invoke db:load_config 
** Execute db:schema:load
-- enable_extension("plpgsql")
rake aborted!
fe_sendauth: no password supplied
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `initialize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `new'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `connect'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:542:in `initialize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:53:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:611:in `connection'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:624:in `block in method_missing'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:597:in `block in say_with_time'
/usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:597:in `say_with_time'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:617:in `method_missing'
/home/hifriend/refugerestrooms/db/schema.rb:17:in `block in <top (required)>'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/schema.rb:42:in `instance_eval'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/schema.rb:42:in `define'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/schema.rb:62:in `define'
/home/hifriend/refugerestrooms/db/schema.rb:14:in `<top (required)>'
/var/lib/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/var/lib/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
/var/lib/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/var/lib/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:253:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/var/lib/gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:260:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/var/lib/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.0.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => db:schema:load

有人知道这里发生了什么事吗?

答案1

我对 ruby​​ on rails 的经验很少,但通过阅读输出,我怀疑这是一个密码问题。

第 8 行内容如下:

fe_sendauth: no password supplied

然后转向中间:

Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"bathrooms_development", "pool"=>5, "host"=>"localhost", "username"=>"root", "password"=>nil}
fe_sendauth: no password supplied

似乎服务器需要密码才能建立连接,但您没有在连接字符串中提供密码。如果我没记错的话,建议在开发 RoR 应用程序时使用“开放”(即无密码)帐户。

我建议你创建一个数据库用户所有管理员(坏主意,抱歉) create权限但没有密码,并将该帐户用于开发目的。在 postgres 服务器的本地/测试实例上执行此操作以避免暴露任何数据。

答案2

您需要在文件中为 Postgres 服务器指定数据库适配器设置config/database.yml。使用类似以下内容:

development:
  adapter: postgresql
  host: 127.0.0.1
  database: my_app_db 
  schema_search_path: my_app_schema, public
  encoding: unicode
  pool: 5
  timeout: 5000
  username: my_user
  password: my_pass

有关使用 Postgres 设置 Rails 的更多详细信息,您可以尝试本指南

相关内容