Skip to content

Instantly share code, notes, and snippets.

@databyte
Forked from anonymous/Rakefile
Created May 22, 2011 09:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save databyte/4cd2bbe68f98f2f0249f to your computer and use it in GitHub Desktop.
Save databyte/4cd2bbe68f98f2f0249f to your computer and use it in GitHub Desktop.
Non-broken Rake 0.9.0 RakeFile Example
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
module ::YourApplicationName
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
YourApplicationName::Application.load_tasks
@azzab
Copy link

azzab commented Jun 30, 2011

both gists doesn't work for me I still get the same error
rake aborted!
uninitialized constant Rake::DSL
/app/Rakefile:8:in <class:Application>' /app/Rakefile:7:inmodule:LimBuzz'
/app/Rakefile:6:in <top (required)>' /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:inload'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in raw_load_rakefile' /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:inblock in load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in standard_exception_handling' /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:inload_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'

@databyte
Copy link
Author

Rake is now at 0.9.2 and no longer requires the use of including the DSL into your application.
http://rubygems.org/gems/rake

@azzab
Copy link

azzab commented Jul 1, 2011

Thanks but I already use 0.9.2 and I got this problem , any suggestions

@amoldjoshi
Copy link

I am having exact same trouble as described by azzab. I have used 0.9.2. How to fix this?

@azzab
Copy link

azzab commented Jul 10, 2011

I got over it using the following rake 0.9.2 and including require 'rake/dsl_definition'
in the rake file

this is my rakefile now

!/usr/bin/env rake

Add your own tasks in files placed in lib/tasks ending in .rake,

for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', FILE)
require 'rake/dsl_definition'

Limbuzz::Application.load_tasks

@jacobsimeon
Copy link

adding "require 'rake/dsl_definition'" to my rakefile worked for me.
windows 7
rails 3.0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment