From: Brian Candler Date: 2007-04-24T17:39:57+09:00 Subject: Problem with test:units:rcov I'm posting this problem here as I'm not sure whether it's to do with rcov, rails_rcov, rails, rake, or my own application :-) I had rails_rcov working perfectly last week. Now when I try it again on the current iteration of the same project, it bombs out: $ rake --trace test:units:rcov (in /home/candlerb/svn/dev/projects/deploy2/trunk) ** Invoke test:units:rcov (first_time) ** Invoke test:units:clobber_rcov (first_time) ** Execute test:units:clobber_rcov rm -rf ./coverage/units ** Execute test:units:rcov /usr/bin/ruby1.8 "/home/candlerb/svn/dev/projects/deploy2/trunk/vendor/plugins/rails_rcov/tasks/rails_rcov.rake" --run-rake-task=test:units (in /home/candlerb/svn/dev/projects/deploy2/trunk) rake aborted! undefined method `exclude' for nil:NilClass /home/candlerb/svn/dev/projects/deploy2/trunk/Rakefile:10 (See full trace by running task with --trace) rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 "/home/candlerb/svn/dev/p...] /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:719:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:726:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:805:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:800:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:740:in `ruby' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:805:in `ruby' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:800:in `ruby' /home/candlerb/svn/dev/projects/deploy2/trunk/config/../vendor/plugins/rails_rcov/tasks/rails_rcov.rake:83:in `new_rcov_task' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16 However, the unit tests by themselves are just fine (rake test:units) Now, several things have changed since rcov was last working. I've made a lot of changes to the application itself - but as I say, the tests are still passing. I've also done a gem update to get from rails 1.2.2 to 1.2.3, which means I have various different versions of things lying around: $ ls /usr/lib/ruby/gems/1.8/gems/ actionmailer-1.3.2 cgi_multipart_eof_fix-2.1 rails-1.2.3 actionmailer-1.3.3 daemons-1.0.5 rake-0.7.1 actionpack-1.13.2 fastthread-1.0 rake-0.7.3 actionpack-1.13.3 flexmock-0.5.0 rcov-0.8.0.2 actionwebservice-1.2.2 gem_plugin-0.2.2 rubyforge-0.4.0 actionwebservice-1.2.3 haml-1.0.5 RubyInline-3.6.2 activerecord-1.15.2 hoe-1.2.0 sources-0.0.1 activerecord-1.15.3 mongrel-1.0.1 xml-simple-1.0.11 activesupport-1.4.1 mongrel_cluster-0.2.1 zentest-3.5.0 activesupport-1.4.2 rails-1.2.2 However I tried setting RAILS_GEM_VERSION='1.2.2' in config/environment.rb but this made no difference. The rails_rcov version is -r12 from subversion. $ svn propget svn:externals vendor/plugins/ rails_rcov http://svn.codahale.com/rails_rcov $ svn update Fetching external item into 'vendor/plugins/rails_rcov' External at revision 12. Now, what's annoying is that there is no filename or line number to identify where the "undefined method `exclude' for nil:NilClass" exception occured, except /home/candlerb/svn/dev/projects/deploy2/trunk/Rakefile:10 which is just require 'tasks/rails' Anyone got any ideas how I can narrow this down? Thanks, Brian.