Rake db:migrate stopped working after bundle update - ruby-on-rails

Hope this is a simple question for some of you..
I've updated my gems bundle and somehow I can't migrate my db anymore..
This is the full trace:
Supreme:supportactie Supreme$ rake db:migrate --trace
rake aborted!
undefined method `task' for #<Supportactie::Application:0x1037ffa40>
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:214:in `initialize_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:139:in `load_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/Users/Supreme/Websites/iceworld/supportactie/Rakefile:7
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:78:in `load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:61:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Hope someone can help me out, cause I do not have any tables left to work with!
Thanks

It looks like there's a possible answer here.

Related

heroku run rake db:migrate fails with "cannot load such file -- debugger"

I'm getting this weird error when I try to migrate my database. Does anyone know what's going on?
There are no require debugger calls in any of my migrations. I do have some in another rake task that's not a migration, though. Is it possible that that's the problem?
me$ heroku run rake db:migrate --trace
Running `rake db:migrate --trace` attached to terminal... up, run.2463
rake aborted!
cannot load such file -- debugger
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/app/lib/tasks/misc.rake:6:in `<top (required)>'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.0/lib/rails/engine.rb:641:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.0/lib/rails/engine.rb:641:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.0/lib/rails/engine.rb:641:in `run_tasks_blocks'
/app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.0/lib/rails/application.rb:244:in `run_tasks_blocks'
/app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.0/lib/rails/engine.rb:446:in `load_tasks'
/app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/app/Rakefile:6:in `<top (required)>'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/rake_module.rb:25:in `load'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/rake_module.rb:25:in `load_rakefile'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/application.rb:637:in `raw_load_rakefile'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/application.rb:94:in `block in load_rakefile'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/application.rb:165:in `standard_exception_handling'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/application.rb:93:in `load_rakefile'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/application.rb:77:in `block in run'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/application.rb:165:in `standard_exception_handling'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/rake/application.rb:75:in `run'
/app/bin/rake:4:in `<main>'
Ah, ok. Figured it out. One my other rake tasks had require debugger in its root scope. That's what was throwing heroku off. Problem solved.

Having trouble with rake

I am trying to run the database migrations that I've just created. Rake worked well before, I think I messed up the dependencies or the versions. Here is what I get when running.
rake:db:migrate --trace
rake aborted!
no such file to load -- rake/rdoctask
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `require'
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `load'
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/tasks.rb:15
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `each'
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/tasks.rb:6
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:214:in `require'
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:214:in `initialize_tasks'
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `send'
/var/lib/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/home/maaz/Desktop/rails_apps/todo/Rakefile:7
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:581:in `raw_load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:87:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:86:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:70:in `run'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:68:in `run'
/var/lib/gems/1.8/gems/rake-10.0.2/bin/rake:37
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

uninitialized constant Rake::DSL

I met the problem 'uninitialized constant Rake::DSL'.
I have tried to add gem 'rake','0.8.7' in the Gemfile, but it didn't work out. Are there any other way to fix the problem? Thank you!
n177-p118:testapp shuang$ rake db:migrate --trace
(in /Users/shuang/rails/testapp)
rake aborted!
uninitialized constant Rake::DSL
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2503:in `const_missing'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/tasks/documentation.rake:11
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/tasks.rb:15:in `load'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/tasks.rb:15
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/tasks.rb:6:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/tasks.rb:6
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:289:in `require'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:289:in `initialize_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie.rb:184:in `instance_exec'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie.rb:184:in `load_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie.rb:184:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie.rb:184:in `load_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:424:in `load_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:145:in `load_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
/Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/shuang/rails/testapp/rakefile:8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2383:in `load'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2000:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:31
This is probably horribly bad form, but adding this to the top of my Rakefile worked for me:
module Rake
module DSL
end
end
Check your gemfile.lock, it must be having a version of rake which is > 0.8.7. If yes then delete all then delete all the instance of the version or delete all the content of gemfile.lock and then do bundle install again.
You can also try to run
bundle exec rake db:migrate

rake db:create ruby on rails

When i am running rake db:migrate i am getting the following error . Please let me know the reason.
Environment - Windows 7 Home Premium
Rails
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
F:/example/ROR//vendor/plugins/savage-beast/lib/tasks/savage_beast.rake:2
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load'
F:/ruby187/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:13
F:/ruby187/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:13:in `each'
F:/ruby187/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:13
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
F:/example/ROR/Rakefile:10
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
F:/Ruby187/bin/rake:19:in `load'
F:/Ruby187/bin/rake:19
It seems that Rails gem is not installed properly because Rake:db create is a Rails method and it seems in your case that it is not running properly.
You can refer this
Step By Step Installer
You could try the following command rake db:create:all followed by rake db:migrate You coudl get this error if you have no databses setup for your project. And do you have a database.yml file in your app/config folder?

When i run rake db:create ,Error rake aborted! uninitialized constant Cucumber

I am trying to experiment on an open source application application .
when i run
$ rake db:create
Following is the stacktrace
rake aborted!
uninitialized constant Cucumber
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
/home/BigBangTheory/Desktop/spot-us/lib/tasks/cucumber.rake:13
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1882:in `in_namespace'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:910:in `namespace'
/home/BigBangTheory/Desktop/spot-us/lib/tasks/cucumber.rake:12
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/rails.rb:8
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/rails.rb:8:in `each'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/rails.rb:8
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/BigBangTheory/Desktop/spot-us/Rakefile:9
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Any help ?
You need Cucumber!
[~/railsapp]$ script/plugin install git://github.com/aslakhellesoy/cucumber.git

Resources