If you need to use the latest version of Rake with Rails 3 you will need to require dsl_definition in your Rakefile. Other wise you need to remove the newest version of rake and declare what version you need to use.
Check out your current Rake versions with $ gem list . See which versions of rake you have and remove them all except for 0.8.7. You can remove the gems with gem uninstall rake -v=0.9.1 or whatever version you need to remove.
Unless you have to use the older version of Rake it is easier to add this line require 'rake/dsl_definition' to your Rails's app Rakefile.