# Converting to Rails 2.0.2

**URL:** <https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469>\
**Category:** RSpec\
**Created:** [December 29, 2007, 12:12am UTC](https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469 "2007-12-29T00:12:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [December 29, 2007, 12:12am UTC](https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469/1 "2007-12-29T00:12:23Z")

</div>

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

Anyone know what’s up here?

Thx

–s

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [December 29, 2007, 2:31am UTC](https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469/2 "2007-12-29T02:31:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [December 29, 2007, 4:18am UTC](https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469/3 "2007-12-29T04:18:39Z")

</div>

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](http://rspec.rubyforge.org/svn/trunk/rspec)  
vendor/plugins/rspec\_on\_rails  
[http://rspec.rubyforge.org/svn/trunk/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

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [December 29, 2007, 11:19am UTC](https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469/4 "2007-12-29T11:19:36Z")

</div>

On Dec 28, 2007 11:56 PM, s.ross [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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: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
