我需要从 rails 运行一些外部操作系统命令,我需要向用户显示它们的输出和退出代码。我检查了Delayed::Job API,但没有看到如何获取作业的标准输出。尝试过BJ (BackgroungJob) - 它有 stdout、stderr 和 exit_status 方法,但它在 rails 开始时失败:
~/my_src/ruby_apps/ro > script/rails c
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_primary_key is deprecated. Please use `self.primary_key = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_primary_key is deprecated. Please use `self.primary_key = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
DEPRECATION WARNING: Calling set_primary_key is deprecated. Please use `self.primary_key = 'the_name'` instead. (called from <top (required)> at /home/zhoran/my_src/ruby_apps/ro/config/application.rb:7)
script/rails:6: stack level too deep (SystemStackError)
似乎它与 3.2.3 不兼容
请帮助我从延迟的工作中获取标准错误、标准输出和退出代码,或者建议类似的 BJ。