【发布时间】:2014-02-10 19:41:03
【问题描述】:
我正在尝试在 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>'
我什至卸载了 psych 并重新安装了它,但它似乎不起作用。我在 rails 3.2.13 和 ruby 2.0
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 rubygems whenever