5
這是一個非常奇怪的問題。我試着做一個簡單的rake db:test:clone
或創建並不管我做什麼,從清除到寶石嘗試各種各樣的database.yml的configs的,即時得到最奇怪的錯誤:無法在rails 3.2中使用postgres創建測試數據庫
LINE 1: CREATE DATABASE "tdt_test"0.0
有沒有人見過這樣的事之前? WTF是「0.0!?」我運行Rails 3.2,RSpec和pg寶石0.14.1
04:15 PM ~/projects/dmvcs (feature/helpdesk) => RAILS_ENV=test rake db:create
/Users/jlippiner/.rvm/gems/[email protected]/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/[email protected]/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `async_exec'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `block in execute'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:653:in `execute'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `create_database'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:107:in `rescue in create_database'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:51:in `create_database'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:40:in `block (3 levels) in <top (required)>'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:40:in `each'
/Users/jlippiner/.rvm/gems/[email protected]/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:40:in `block (2 levels) in <top (required)>'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/jlippiner/.rvm/gems/[email protected]/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/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/jlippiner/.rvm/gems/[email protected]/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/jlippiner/.rvm/gems/[email protected]/bin/rake:19:in `load'
/Users/jlippiner/.rvm/gems/[email protected]/bin/rake:19:in `<main>'
/Users/jlippiner/.rvm/gems/[email protected]/bin/ruby_noexec_wrapper:14:in `eval'
/Users/jlippiner/.rvm/gems/[email protected]/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'
+ 1你用另一個分類器去了嗎?或者在發生此錯誤時暫時移除寶石? – Dru
我只是在我的Gemfile中設置require => false,即: gem'classifier',:require => false – rainkinz
與descriptive_statistics gem相同。 – stwienert