Converting to Rails 2.0.2

I’m moving an older project to Rails 2.0.2 and ran into a roadblock on
the version matching. Here’s script/console session:

Spec::VERSION::REV
=> “1785”

Spec::Rails::VERSION::REV
NoMethodError: undefined method run=' for Test::Unit:Module from /Users/sxross/rails/tastie_work/vendor/plugins/rspec_on_rails/ lib/spec/rails.rb:16 from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:203:inload_without_new_constant_marking’
from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/
lib/…/…/activesupport/lib/active_support/dependencies.rb:203:in
load_file' from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/
lib/…/…/activesupport/lib/active_support/dependencies.rb:202:in
load_file' from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:94:inrequire_or_load’
from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/
lib/…/…/activesupport/lib/active_support/dependencies.rb:248:in
load_missing_constant' from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:453:inconst_missing’

The project uses trunk versions of rspec and rspec_on_rails, along
with current Rails edge (at this point, 8506). After upgrading Rails
and some of the normal monkeying around, I did a script/generate rspec
(nothing of note there and replaced all just to be sure). Then:

rake spec does this:

Users/sxross/rails/tastie_work/vendor/rails/activerecord/lib/…/…/
activesupport/lib/active_support/dependencies.rb:263:in
load_missing_constant': uninitialized constant Spec::VERSION::REV (NameError) from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:453:inconst_missing’
from /Users/sxross/rails/tastie_work/vendor/plugins/rspec_on_rails/
lib/spec/rails/version.rb:13
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:inrequire’
from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/
lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/
lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' from /Users/sxross/rails/tastie_work/vendor/plugins/rspec_on_rails/ lib/spec/rails.rb:11 ... 11 levels... from /Library/Ruby/Gems/1.8/gems/rspec-1.1.1/lib/spec/runner/ example_group_runner.rb:13:inload_files’
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.1/lib/spec/runner/
options.rb:83:in run_examples' from /Library/Ruby/Gems/1.8/gems/rspec-1.1.1/lib/spec/runner/ command_line.rb:19:inrun’
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.1/bin/spec:3

Anyone know what’s up here?

Thx

–s

The REV constants no longer exist in trunk (and haven’t for a while),
yet somehow your rspec_on_rails in vendor is still expecting it.
Meaning you don’t actually have a copy of trunk in
plugins/rspec_on_rails, I guess.

HTH

Kyle

How strange… I’ve been having some svn misbehavior so I decided to
clone the tree and not do any plugin installations – simply external
references to the correct repos. So this is a today project and these
are the externals from svn propedit:

vendor/plugins/rspec
http://rspec.rubyforge.org/svn/trunk/rspec
vendor/plugins/rspec_on_rails
http://rspec.rubyforge.org/svn/trunk/rspec_on_rails

I’ll keep looking into this to see why my installation would have gone
so wrong.

Thanks for the info…

–s

On Dec 28, 2007 11:56 PM, s.ross [email protected] wrote:

lib/…/…/activesupport/lib/active_support/dependencies.rb:203:in
from /Users/sxross/rails/tastie_work/vendor/rails/activerecord/
with current Rails edge (at this point, 8506). After upgrading Rails
lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in
lib/…/…/activesupport/lib/active_support/dependencies.rb:342:in
options.rb:83:in run_examples' from /Library/Ruby/Gems/1.8/gems/rspec-1.1.1/lib/spec/runner/ command_line.rb:19:inrun’
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.1/bin/spec:3

The culprit is right here in your stack trace. You’re running with a
pre-trunk gem version of RSpec that isn’t compatible with Spec::Rails
trunk.

Uninstall your existing RSpec gem. A more long term solution would be
to make sure plugged-in rspec is always on $LOAD_PATH before the
gemmed one, but that might be a little tricky.

Aslak