Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
deanpcmad opened this issue Aug 9, 2011 · 7 comments
Closed

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

deanpcmad opened this issue Aug 9, 2011 · 7 comments

Comments

@deanpcmad
Copy link

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.

@deanpcmad
Copy link
Author

I am running Ruby 1.9.2p180

@fuzzyalej
Copy link

Same here:

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

@deanpcmad
Copy link
Author

What version of Rubygems are you using?

@fuzzyalej
Copy link

@deanpcmad
Copy link
Author

Ah ok thanks, will give it a go :)

@deanpcmad
Copy link
Author

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

@fuzzyalej
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants