So after I updated all my gems, I started getting:
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/
dependencies.rb:105:in const_missing': uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError) from /Library/Ruby/Gems/1.8/gems/test-unit-2.0.3/lib/test/unit/ testresult.rb:28 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:158:inrequire’
from /Library/Ruby/Gems/1.8/gems/rspec-1.2.8/lib/spec/interop/test.rb:
8
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/dependencies.rb:158:in require' from /Library/Ruby/Gems/1.8/gems/rspec-1.2.8/lib/spec/test/unit.rb:1 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:158:inrequire’
from /Library/Ruby/Gems/1.8/gems/rspec-rails-1.2.7.1/lib/spec/
rails.rb:13
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/dependencies.rb:158:in `require’
from /Users/ignu/code/surveighor/spec/spec_helper.rb:6
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
active_support/dependencies.rb:158:in require' gem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:158:in require’
from /Users/ignu/code/surveighor/spec/spec_helper.rb:6
What versions of rails, rspec and rspec-rails were you using
successfully before you did this upgrade? Did you run “script/generate
rspec”? Were you seeing test/unit output before the upgrade?
What versions of rails, rspec and rspec-rails were you using
successfully before you did this upgrade? Did you run “script/generate
rspec”? Were you seeing test/unit output before the upgrade?
I have the same problem
I’m using
Rails 2.3.4 in vendor/rails
Rspec 1.2.8
Rspec-Rails 1.2.7.1
I load the rspec libraries in the test.rb file
config.gem “rspec”, :version => ‘1.2.8’, :lib => ‘spec’
config.gem “rspec-rails”, :version => ‘1.2.7.1’, :lib => false
If I execute: “rake spec” in the console I got:
anything
If I execute: “RAILS_ENV=test rake spec” in the console I got:
Loaded suite /usr/local/bin/rake
Started
If I change to :lib => false I got the same text in the execution. But
If I uninstall test-unit 2.0.3 like Len said the examples executes
right.
There’s a pernicious known bug in RSpec that causes it to fail with
newer versions of the test-unit gem. This has a stronger impact on
those of us using Ruby 1.9, which doesn’t include Test::Unit at all,
and is somewhat documented here:
I made a brief attempt at one point to figure out what broke with
newer Test::Unit versions, but got a bit lost just setting up the
RSpec-Dev project to pass all specs. Really troubleshooting RSpec
internals is probably beyond me.
So I’ll be a smartass instead: David, given the broad impact and
confusing output of the test-unit dependency problem, would it be a
practical short-term solution to simply bundle version 1.2.3 of the
Test::Unit gem into RSpec? And then require the bundled Test::Unit
directly on its path instead of the gem and Ruby loadpaths?
Sure, for stock Ruby 1.8 users this would be redundant, but they
wouldn’t really lose anything. And everyone on 1.9 or running the
Test::Unit gem for other purposes gains reliability and a much easier
path to getting RSpec running the first time. It’s not an ideal
solution but it’d be quick to set up. Is there a reason why this
wouldn’t work or shouldn’t be done?
Test::Unit gem into RSpec? And then require the bundled Test::Unit
directly on its path instead of the gem and Ruby loadpaths?
Sure, for stock Ruby 1.8 users this would be redundant, but they
wouldn’t really lose anything. And everyone on 1.9 or running the
Test::Unit gem for other purposes gains reliability and a much easier
path to getting RSpec running the first time. It’s not an ideal
solution but it’d be quick to set up. Is there a reason why this
wouldn’t work or shouldn’t be done?
I’ll give this some thought, though I’d much rather just solve the
problem. For the 1.2.9 release I added a message. When you run specs
w/ test/unit interop (which is implicit in rspec-rails) it senses
whether t/u 1.2.3 is loaded - if not it raises an error explaining
your options.
In terms of solving the problem, there are a few paths:
Figure out why ruby 1.9 + rubygems + activesupport is allowing two
different versions of the same gem to be loaded.
Get rspec to play nice w/ test-unit-2.0.3
Get rspec to play nice w/ minitest.
Some combination of 1, 2, and 3.
This probably won’t get resolved (by me) until we release rspec-2,
work on which has begun but it’s waiting for me to get the book off to
print before it gets the full love and attention it needs. If anybody
out there wants to help w/ any of the above, please fork the repo, get
it to work, and if it works well I’ll be glad to merge it back in.
Test::Unit gem into RSpec? �And then require the bundled Test::Unit
directly on its path instead of the gem and Ruby loadpaths?
Sure, for stock Ruby 1.8 users this would be redundant, but they
wouldn’t really lose anything. �And everyone on 1.9 or running the
Test::Unit gem for other purposes gains reliability and a much easier
path to getting RSpec running the first time. �It’s not an ideal
solution but it’d be quick to set up. �Is there a reason why this
wouldn’t work or shouldn’t be done?
I’ll give this some thought, though I’d much rather just solve the
problem. For the 1.2.9 release I added a message. When you run specs
w/ test/unit interop (which is implicit in rspec-rails) it senses
whether t/u 1.2.3 is loaded - if not it raises an error explaining
your options.
In terms of solving the problem, there are a few paths:
Figure out why ruby 1.9 + rubygems + activesupport is allowing two
different versions of the same gem to be loaded.
Get rspec to play nice w/ test-unit-2.0.3
Get rspec to play nice w/ minitest.
Some combination of 1, 2, and 3.
This probably won’t get resolved (by me) until we release rspec-2,
work on which has begun but it’s waiting for me to get the book off to
print before it gets the full love and attention it needs. If anybody
out there wants to help w/ any of the above, please fork the repo, get
it to work, and if it works well I’ll be glad to merge it back in.
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
config.gem ‘test-unit’, :lib => ‘test/unit’
Any ideas?