实现db:drop in rails 3.2时rake aborted错误

时间:2013-03-29 13:12:35

标签: ruby-on-rails ruby ruby-on-rails-3.2

我是rails的新手。我正在尝试rake db:drop但是我收到了以下错误

rake aborted!
(<unknown>): mapping values are not allowed in this context at line 21 column 12
/home/chiron/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/application/configuration.rb:115:in `database_configuration'
/home/chiron/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.11/lib/active_record/railties/databases.rake:25:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:drop => db:load_config
(See full trace by running task with --trace) 

我在ubuntu上安装。在为Windows环境工作相同的代码时,它似乎完美无缺

我的database.yml如下: -

# PostgreSQL v0.8.x
#   gem install pg
development:
  adapter: postgresql
  encoding: unicode
  host: localhost
  database: lib_development
  pool: 5
  username: chiron
  password: 

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: postgresql
  encoding: unicode
  host: localhost
  database: lib_test
  pool: 5
   username: chiron
  password: 

production:
  adapter: postgresql
  encoding: unicode
  host: localhost
  database: lib_production
  pool: 5
   username: chiron
  password: 

任何人都可以帮助我

1 个答案:

答案 0 :(得分:2)

您在配置

中有冗余空格键
  pool: 5
   username: chiron # << here
  password: