Hello All,

 I followed steps to install Rspec as in the link pasted below.

http://www.pmamediagroup.com/2009/04/tutorial-install-rspec-rails-factory-girl/

I have jRuby on Rails installed on my machine.Hence all commands need
to be run with jruby -S extension.
However when I run the jruby -S rake spec command,I get the following
error as shown below.

************************************************************************************************************************
C:\Rspec Test>jruby -S rake spec --trace
(in C:/Rspec Test)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
db pool warmup starting...................... Mon Sep 12 18:05:23
+0530 2011

warmed
up...........===========================================..............

db pool warmup done........................... Mon Sep 12 18:05:23
+0530 2011

** 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
RspecTest already exists
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
rake aborted!
ActiveRecord::ActiveRecordError: ERROR: cannot drop table channels
because other
 objects depend on it
  Detail: constraint messages_channel_id_fk on table messages depends
on table c
hannels
constraint invitation_workflow_mapping_invitor on table
invitation_workflows dep
ends on table channels
constraint invitation_workflow_mapping_invited_whom_id on table
invitation_workf
lows depends on table channels
constraint invitation_workflow_mapping_invited_for_channel_id on table
invitatio
n_workflows depends on table channels
  Hint: Use DROP ... CASCADE to drop the dependent objects too.: DROP
TABLE "cha
nnels"
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/
connection_adapters/ab
stract_adapter.rb:219:in `log'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.7-
java/lib/a
ctive_record/connection_adapters/jdbc_adapter.rb:582:in `execute'
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/
connection_adapters/ab
stract/schema_statements.rb:187:in `drop_table'
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/
connection_adapters/ab
stract/schema_statements.rb:107:in `create_table'
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/migration.rb:
352:in `m
ethod_missing'
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/migration.rb:
328:in `s
ay_with_time'
c:/jruby-1.5.0/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/migration.rb:
328:in `s
ay_with_time'
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/migration.rb:
348:in `m
ethod_missing'
C:/Rspec Test/db/schema.rb:139
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/schema.rb:
43:in `insta
nce_eval'
C:/Rspec Test/vendor/rails/activerecord/lib/active_record/schema.rb:
43:in `defin
e'
C:/Rspec Test/db/schema.rb:12
C:/Rspec Test/db/schema.rb:269:in `load'
C:/Rspec Test/vendor/rails/railties/lib/tasks/databases.rake:269
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`call'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`execute'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`each'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke'
C:/Rspec Test/vendor/rails/railties/lib/tasks/databases.rake:317
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`call'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`execute'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`each'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke'
C:/Rspec Test/vendor/rails/railties/lib/tasks/databases.rake:391
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`call'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`execute'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`each'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in
`invoke_prer
equisites'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
`each'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
`invoke_prer
equisites'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with
_call_chain'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_tas
k'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level'

c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`each'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level'

c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_e
xception_handling'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
`top_level'

c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in
`run'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_e
xception_handling'
c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in
`run'
C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:19:in `load'
c:/jruby-1.5.0/bin/rake:19


************************************************************************************************************************


What does the error indicate,I tried commenting all lines having
drop_database statement in them.
Another thing is that the database already has tables and by using the
tutorial I have just added another table for the bank-account.
Kindly let me know what exactly needs to be done in this case

Thanks & Regards
Chandrika
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to