简体   繁体   中英

Psych error when using whenever gem in ruby

I am trying to use the whenever gem in ruby. I installed the latest version (0.9.0). I created the schedule.rb file as well. However none of the whenever commands seem to be working from the command line. I tried whenever --update-crontab and even whenever -- help but both gave me the following error:

/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/i686-linux/psych.so: warning: already initialized constant Psych::Parser::ANY
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/i686-linux/psych.so: warning: already initialized constant Psych::Parser::UTF8
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/i686-linux/psych.so: warning: already initialized constant Psych::Parser::UTF16LE
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/i686-linux/psych.so: warning: already initialized constant Psych::Parser::UTF16BE
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/psych/syntax_error.rb:5:in `<module:Psych>': superclass mismatch for class SyntaxError (TypeError)
    from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/psych/syntax_error.rb:1:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/psych.rb:1:in `require'
    from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/psych.rb:1:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext/big_decimal/conversions.rb:4:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext/big_decimal/conversions.rb:4:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext/big_decimal.rb:1:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext/big_decimal.rb:1:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext.rb:2:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext.rb:2:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext.rb:1:in `each'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/core_ext.rb:1:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/all.rb:3:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/activesupport-3.2.13/lib/active_support/all.rb:3:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/whenever-0.8.4/lib/whenever.rb:2:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/whenever-0.8.4/lib/whenever.rb:2:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/whenever-0.8.4/bin/whenever:4:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/whenever-0.8.4/bin/whenever:4:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/whenever:23:in `load'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/whenever:23:in `<main>'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
    from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'

I even unistalled psych and reinstalled it but it doesn't seem to work. I am on rails 3.2.13 and ruby 2.0

卸载psych ,现在可以使用。

gem uninstall psych

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM