Rspec error

Hello,

I’m getting the following error when I run

rake spec --trace

Seems a little too deep in the stack for me to figure it out.

Thanks,

GP

** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
rake aborted!
closed stream
c:/ruby/lib/ruby/1.8/mysql.rb:1032:in sync=' c:/ruby/lib/ruby/1.8/mysql.rb:1032:inwrite’
c:/ruby/lib/ruby/1.8/mysql.rb:1092:in finalizer' c:/ruby/lib/ruby/1.8/mysql.rb:578:incall’
c:/ruby/lib/ruby/1.8/mysql.rb:578:in start' c:/ruby/lib/ruby/1.8/mysql.rb:578:infree’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_a
dapters/mysql_adapter.rb:304:in select_rows' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_a dapters/abstract/database_statements.rb:27:inselect_values’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_a
dapters/abstract/schema_statements.rb:343:in
assume_migrated_upto_version' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb :346:insend’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
:346:in method_missing' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb :326:insay_with_time’
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb :326:insay_with_time’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
:342:in method_missing' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/schema.rb:47 :indefine’
D:/joytorrent/mobenabler/db/schema.rb:12
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:142:in load_without_new_constant_marking' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci es.rb:142:inload’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:521:in new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci es.rb:142:inload’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:253
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in call' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:inexecute’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:inexecute’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in
invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:insynchronize’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:ininvoke’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:298
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in call' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:inexecute’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:inexecute’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in
invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:insynchronize’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:ininvoke’
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:372
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in call' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:inexecute’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:inexecute’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in
invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:insynchronize’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:ininvoke_prerequisit
es’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:ininvoke_prerequisit
es’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in
invoke_with_call_c hain' c:/ruby/lib/ruby/1.8/monitor.rb:242:insynchronize’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:ininvoke’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in
invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:intop_level’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:intop_level’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
standard_exceptio n_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:intop_level’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:instandard_exceptio
n_handling’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/ruby/bin/rake:19:inload’
c:/ruby/bin/rake:19

seems there is a problem with your database or its schema. did you
configure your database.yml correctly for your test-db?

check whether you can access that db with given username/password.
also check if there are migrations pending or sth like it.

are you able to access test-db with
script/console test
?

try to get into your console (test-env) and create a new instance of
one of your models and save it to see whether your database-
connnection is working properly.

Hello,

I have exactly the same problem, did you find a way to solve it ?

I can access my database with script/console in the test environment.
I can run rake db:migrate in the test environment,
and I can insert datas in my database through the console.

Many thanks