[rspec-users] rake spec:models failing

Keith McDonnell keith at dancingtext.com
Thu Oct 18 08:58:11 EDT 2007

Hi there,

I'm having trouble with `rake spec:models`. It's failing on:

- 1 old rspec/rails project
- all new rspec/rails projects

But, it *is* working fine on my other (older) rspec/rails projects. All 
projects are on rspec & rails 1.0.8, Rails 1.2.3, os X ppc

Here's a fresh rspec/rails project with failing rake task

$ rails test_app -d postgresql
$ cd test_app/
$ jedit config/database.yml
$ createdb test_app_test
$ createdb test_app_development

$ ./script/plugin install 
$ ./script/plugin install http://rspec.rubyforge.org/svn/tags/CURRENT/rspec

$ ./script/generate rspec
$ ./script/generate rspec_model Account
$ jedit db/migrate/001_create_accounts.rb app/models/account.rb 

$ rake spec:models
(in /Users/kmcd/tmp/test_app)
undefined method `[]' for nil:NilClass (NoMethodError)
         from /Users/kmcd/tmp/test_app/vendor/plugins/rspec/lib/spec.rb:2
         from /Users/kmcd/tmp/test_app/vendor/plugins/rspec/bin/spec:2
rake aborted!
Command ruby -I"/Users/kmcd/tmp/test_app/vendor/plugins/rspec/lib" 
"spec/models/account_spec.rb" --options 
"/Users/kmcd/tmp/test_app/config/../spec/spec.opts" failed


In my older project the tables aren't loading into the test database. 
All specs fail with:

RuntimeError: ERROR     C42P01  Mrelation "table_name" does not exist

I've checked my other rspec & rails projects -- they're fine.

I've also checked out previous revisions of the failing project which 
ran `rake spec:models` successfully. They all now fail with the same 
error (no tables in test db).

Any ideas how to track this one down? I've spent 3 hours on it without 



More information about the rspec-users mailing list