5

这是一件极其奇怪的事情。我试图做一个简单的rake db:test:clone或创建的,无论我做什么,从清除 gemset 到尝试各种 database.yml 配置,我都会遇到最奇怪的错误:

LINE 1: CREATE DATABASE "tdt_test"0.0

有没有人见过这样的东西?WTF 那是“0.0!?” 我正在运行 Rails 3.2、RSpec 和 pg gem 0.14.1

 04:15 PM ~/projects/dmvcs (feature/helpdesk) => RAILS_ENV=test rake db:create
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
  Notice: for 10x faster LSI support, please install http://rb-gsl.rubyforge.org/
  PG::Error: ERROR:  syntax error at or near "0.0"
  LINE 1: CREATE DATABASE "tdt_test"0.0
                                    ^
  : CREATE DATABASE "tdt_test"0.0
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `async_exec'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `block in execute'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:653:in `execute'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `create_database'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:107:in `rescue in create_database'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:51:in `create_database'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:40:in `block (3 levels) in <top (required)>'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:40:in `each'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:40:in `block (2 levels) in <top (required)>'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
  /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/bin/ruby_noexec_wrapper:14:in `eval'
  /Users/jlippiner/.rvm/gems/ruby-1.9.3-p194@dmvcs/bin/ruby_noexec_wrapper:14:in `<main>'
  Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"tdt_test", "username"=>"jlippiner", "pool"=>5, "password"=>nil}
  /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: db:create (ArgumentError)
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:21:in `run'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
    from /Users/jlippiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
4

1 回答 1

8

这是一种特殊情况,但它可能对其他人有所帮助。

原来该死的分类器 gem 正在重写 Array.sum 方法。一旦我删除它,一切都很好。

于 2012-10-11T21:35:55.927 回答