Rake aborted

I’ve been trying to follow Ruby on Rails 3 Tutorial by Michael H. but
had a problem on page 199 when it asks me to enter “rake db:migrate”. I
got the following results:

rake aborted!
undefined method `mass_assignment_sanitizer=’ for
ActiveRecord::Base:Class

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

How do I get rake to work?

On Jun 21, 2012, at 12:32 PM, n/a n/a wrote:


How do I get rake to work?

I would try running bundle update to make sure you have all of your gems
properly installed. This sounds like a version mis-match between various
Rails modules.

Walter

I tried running bundle update but then I still got the same error on
rake db:migrate.

—Original message—


How do I get rake to work?

I would try running bundle update to make sure you have all of your gems
properly installed. This sounds like a version mis-match between various
Rails modules.

Walter

What version of rake, what version of Ruby, what version of Rails? Also,
what version of Gem? There’s lots of reasons why this might not work.
Are you using rvm? If so, make a new gemset and bundle install again
there. Triple check that the version of Rails in your tutorial matches
the version installed on your computer.

Walter

I am using Rails 3.1.0, Gem 1.8.24, and Ruby 1.9.3p194. I’ve edited the
gem file and changed versions of things to try to fix this and other
problems that I have. I think that in order to fix certain problems, I
might end up breaking something else. I tried “gem update --system” and
still had the same problem.

Walter D. wrote in post #1065560:

What version of rake, what version of Ruby, what version of Rails? Also,
what version of Gem? …

Walter’s right. This is just a hunch, but you might try:

gem update --system

and see if that helps.

  • ff

Walter D. wrote in post #1065560:

Triple check that the version of Rails in your tutorial matches
the version installed on your computer.

I got it working. I found a sample gem file at
https://raw.github.com/railstutorial/sample_app_2nd_ed/master/Gemfile
for the tutorial that I am using and this made it work. Thanks for the
help.