Wednesday, May 25, 2011

undefined method task

There's been a few people struggling with the dreaded 'undefined method task' when installing rails 3 with rake 0.9.0.beta4 (currently the latest version of rake that comes with rails automatically). You can get around this issue by putting the following in your Rakefile
require File.expand_path('../config/application', __FILE__)
require 'rake'
module ::Dpp
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
Dpp::Application.load_tasks
view raw gistfile1.rb hosted with ❤ by GitHub


Just make sure the modules are added before the Application.load_tasks call.

No comments:

Post a Comment