Problem in migrating a database to Heroku

When trying to migrate a database to Heroku, I get the following
(Provided that I’m using gem 'sqlite3', '1.3.3':

$ heroku rake db:migrate
(in /app)
rake aborted!
uninitialized constant Rake::DSL
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in

<class:Ta skLib>' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in<module:R
ake>’
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in
<top (req uired)>' /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.9.1/lib/rdoc/task.rb:37:inrequire’
/app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.9.1/lib/rdoc/task.rb:37:in
<top (requi red)>' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentation.r ake:2:inrequire’
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentation.r
ake:2:in <top (required)>' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:inload’

/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in

block in <top (required)>' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:ineach’
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in
<top ( required)>' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:215:inrequire’
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:215:in
initialize_tasks' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:139:inload_tasks’
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:77:in
method_missing' /app/Rakefile:7:in<top (required)>’
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in load' /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:inraw_load_rakefile’
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in block in load_rakefile' /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:instandard_exception_handling’
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in load_rakefile' /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:inrun’
/usr/ruby1.9.2/bin/rake:31:in `’

How can I solve this issue?

Thanks.

There is plenty of information about that error online.

Google “uninitialized constant Rake::DSL”

As an aside having a handle like “SW Engineer” and failing to do
something that simple will open you up to lots of grief.

Unless SW stands for “Soapy Water” in which case you should clarify
things.

Put this in your Rakefile above require ‘rake’

require 'rake/dsl_definition
Check this:

On Thu, Aug 4, 2011 at 6:13 PM, Peter H. <

All problems are solved with Rake gem 0.9.2… I followed these steps:

  • I installed gem install rake -v=0.9.2 (I had the 0.9.1 gem)
  • removed the 0.9.1 with gem uninstall rake -v=0.9.1
  • updated with bundle update

then the db:migrate showed a warning, WARNING: Global access to Rake
DSL
methods is deprecated. Please…

It was solved by adding the following to the Rake file.

module ::YourApplicationName
class Application

     include Rake::DSL
 end

end

If the above code not working means u can specify the rake gem version
in
your gem file
and run command, bundle install from command prompt.

may be it will solve the issue .

On 4 August 2011 13:42, SW Engineer [email protected] wrote:

<class:Ta <top (requi

/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:215:in

/app/Rakefile:7:in `<top (required)>’
How can I solve this issue?
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

   G SubbaRao

   Cell:08970668850

   E-Mail:[email protected]