appelier/bigtuna

"method `to_yaml' not defined in Class" on rake db:create

Closed this issue · 7 comments

I am getting this whenever I go to run rake db:create or rake db:schema:load

dean@ubuntu:/srv/www/bigtuna/public_html$ rake db:create
(in /srv/www/bigtuna/public_html)
rake aborted!
method to_yaml' not defined in Class /usr/local/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.1/lib/delayed/yaml_ext.rb:30:inremove_method'
/usr/local/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.1/lib/delayed/yaml_ext.rb:30:in <class:Class>' /usr/local/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.1/lib/delayed/yaml_ext.rb:28:in<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in require' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:inblock in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in block in load_dependency' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:innew_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in load_dependency' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:inrequire'
/usr/local/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.1/lib/delayed_job.rb:6:in <top (required)>' /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.17/lib/bundler/runtime.rb:68:inrequire'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.17/lib/bundler/runtime.rb:68:in block (2 levels) in require' /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.17/lib/bundler/runtime.rb:66:ineach'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.17/lib/bundler/runtime.rb:66:in block in require' /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.17/lib/bundler/runtime.rb:55:ineach'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.17/lib/bundler/runtime.rb:55:in require' /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.17/lib/bundler.rb:120:inrequire'
/srv/www/bigtuna/public_html/config/application.rb:7:in <top (required)>' <internal:lib/rubygems/custom_require>:29:inrequire'
internal:lib/rubygems/custom_require:29:in require' /srv/www/bigtuna/public_html/Rakefile:4:in<top (required)>'
/usr/local/lib/ruby/1.9.1/rake.rb:2373:in load' /usr/local/lib/ruby/1.9.1/rake.rb:2373:inraw_load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:2007:in block in load_rakefile' /usr/local/lib/ruby/1.9.1/rake.rb:2058:instandard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake.rb:2006:in load_rakefile' /usr/local/lib/ruby/1.9.1/rake.rb:1991:inrun'
/usr/local/bin/rake:31:in `

'

I am running on a Ubuntu 11.04 machine.
I have run bundle install and all the gems have installed correctly.

I am running Ruby 1.9.2p180

Same here:

  • ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
  • rubygems 1.8.10

What version of Rubygems are you using?

Ah ok thanks, will give it a go :)

Where do I put this? Do I just set the delayed_job gem as that git repo?

In lib/delayed/yaml_ext.rb,

change the line:
remove_method :to_yaml # use Module's to_yaml
for:
remove_method :to_yaml if respond_to?(:to_yaml) && method(:to_yaml).owner == Class # use Module's to_yaml