我试图在ruby中使用when gem。我安装了最新版本(0.9.0)。我也创建了schedule.rb文件。但是,无论何时命令似乎都在命令行中运行。我尝试了whenever --update-crontab
甚至whenever -- help
,但两人都给了我以下错误:
/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>'
我甚至不介意心理并重新安装它但它似乎不起作用。我在rails 3.2.13和ruby 2.0
答案 0 :(得分:2)
已卸载psych
,现在可以正常使用。
gem uninstall psych