[rspec-users] Converting to Rails 2.0.2

aslak hellesoy aslak.hellesoy at gmail.com
Sat Dec 29 05:10:49 EST 2007


On Dec 28, 2007 11:56 PM, s.ross <cwdinfo at gmail.com> wrote:
> 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:in
> `load_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:in
> `new_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:in
> `require_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:in
> `const_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:in
> `const_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:in `require'
>         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:in
> `new_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:in `load_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:in `run'
>         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

>
> Anyone know what's up here?
>
> Thx
>
> --s
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list