[Ruby on Rails] uninitialized constant ActiveSupport::~::ForRspec

» Posted by on Apr 21, 2009 in Blog | 0 comments

Today I got an error below with rake.
What happened?

% rake -T
(in /home/ice/messa/hulor)
rake aborted!
uninitialized constant ActiveSupport::Testing::SetupAndTeardown::ForRspec
/home/ice/messa/hulor/Rakefile:12
(See full trace by running task with --trace)

Related gem packages version:

  • rails 2.3.2
  • rspec 1.2.4
  • rspec-rails 1.2.4

I can’t remember what I did. But maybe I installed rails into my project (not on system).
I did below???? I can’t remember.

% rake rails:freeze:edge

#801 ‘No such file to load’ when running ‘rake spec’

Sounds like you’ve got rails edge, not rails-2.3.2. These files moved post-2.3.2 – same with ForRspec – that’s all in rails edge, which is now moving towards rails-3.0, and is not supported by rspec yet in any released version, nor in rspec’s own edge.

This says I installed rails edge, not railse 2.3.2.
To fix this probrem execute this command.

% rake rails:freeze:edge RELEASE=2.3.2
% rake rails:freeze:edge RELEASE=2.3.2
(in /home/ice/messa/hulor)
cd vendor
Downloading Rails from http://dev.rubyonrails.org/archives/rails_2.3.2.zip
Unpacking Rails
rm -rf rails
rm -f rails.zip
rm -f rails/Rakefile
rm -f rails/cleanlogs.sh
rm -f rails/pushgems.rb
rm -f rails/release.rb
touch rails/REVISION_b10fb7e7bcb5efea6c93ae52bad125887cfc235c
cd -
Updating current scripts, javascripts, and configuration settings

fixed. //