有沒有人在運行這個環境中的黃瓜測試時遇到麻煩?rails 3.1.3/cucumber/database_cleaner/mongo_mapper
錯誤
Exception encountered by DatabaseCleaner in Cucumber After block: ActiveRecord::ConnectionNotEstablished
ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in `retrieve_connection'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `retrieve_connection'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-rails-1.2.1/lib/cucumber/rails/hooks/active_record.rb:6:in `connection'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.7.1/lib/database_cleaner/active_record/truncation.rb:130:in `clean'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.7.1/lib/database_cleaner/base.rb:77:in `clean'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.7.1/lib/database_cleaner/configuration.rb:56:in `block in clean'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.7.1/lib/database_cleaner/configuration.rb:56:in `each'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.7.1/lib/database_cleaner/configuration.rb:56:in `clean'
/home/jonas/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-rails-1.2.1/lib/cucumber/rails/hooks/database_cleaner.rb:9:in `After'
功能/支持/ env.rb
7 require 'cucumber/rails'
8 require 'database_cleaner'
9 require 'database_cleaner/cucumber'
10 require 'database_cleaner/mongo_mapper/truncation'
...
41 # Remove/comment out the lines below if your app doesn't have a database.
42 # For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
43 begin
44 DatabaseCleaner.strategy = :truncation
45 rescue NameError
46 raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
47 end
我不知道該怎麼做。