Global acccess to Rake DSL methods is deprecated

You may have noticed this error recently running rake db:create or rake db:migrate… The newest version of Rake (0.9+) breaks rails.

If you are getting this error: WARNING: Global access to Rake DSL methods is deprecated. Please Include ....Rake::DSL into classes and modules which use the Rake DSL methods.

There are two ways to fix this

Add the gem version to your Gemfile

gem "rake", "0.8.7"

Remove rake 0.9.1 by running

gem uninstall rake -v=0.9.1

Update rake

bundle update rake
module ::YourApplicationName
   class Application
    include Rake::DSL
  end
end
module ::RakeFileUtils
  extend Rake::FileUtilsExt
end

Let me know if you’re still having problems.

-Matt

·