autotest/rspec/rubygems problems

| | Comments (5)

I just finished diagnosing a problem with two users who were both seeing the following stack trace when firing up autotest:

.../rubygems.rb:325:in `latest_partials':
    undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:322:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:322:in `latest_partials'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:292:in `latest_load_paths'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:291:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:291:in `latest_load_paths'
from /usr/local/lib/ruby/gems/1.8/gems/ZenTest-3.6.0/lib/autotest.rb:109:in `
autodiscover'
from /usr/local/lib/ruby/gems/1.8/gems/ZenTest-3.6.0/bin/autotest:36
from /usr/local/bin/autotest:18:in `load'
from /usr/local/bin/autotest:18

It apparently turns out (ironically), that rspec 0.8 or so installed a bogus gem named "web_spec" with no version or anything and was choking the latest_load_paths method I was using in rubygems. This gem wasn't removed when you removed rspec so it might still be floating around in your system. If so, please remove it.

cd `gem env gem path`/gems
sudo rm -rf web_spec*
cd ../specs
sudo rm -rf web_spec*

5 Comments

Thanks for posting this. I'll make sure this is well doc'd.

Ah! Had the very same problem, but after removing the bogus 'web_spec' gem I ran into the following error using autotest with rails:

script/spec:3:in `require': no such file to load -- spec (LoadError) from script/spec:3

I figured out I just needed to add "require 'rubygems'" to the script/spec file. So everything is working fine now, just wanted to share this incase anyone else runs into this problem.

I ran into the same problem, but it was caused by a sym link in my gems dir. I removed the link and autotest works fine.

I have had this same error message trying to use autotest. After deleting the web_spec* gem I am still getting the very same message. Any further ideas?

It worked! Thanks, I was banging my head against the wall over this.

Leave a comment