[英]AppFog background worker 'failed to start'
I'm trying to follow the AppFog guide on creating a background worker in ruby, and I'm running into some (probably noob) issues. 我正在尝试按照AppFog指南在ruby中创建后台工作程序 ,但遇到了一些(可能是菜鸟)问题。 The example uses
Rufus-scheduler
, which (according to the Ruby docs on AppFog ) means I need to use Bundler
to include/manage within my app. 该示例使用
Rufus-scheduler
,(根据AppFog上的Ruby文档 ),这意味着我需要使用Bundler
在应用程序中包含/管理。 Nonetheless, I've run bundle install
, pushed everything to AppFog in the appropriate ('standalone') fashion, and still can't seem to get it running. 尽管如此,我已经运行
bundle install
,以适当的(“独立”)方式将所有内容推送到AppFog,但似乎仍然无法使其运行。
my App & Gemfile: 我的App和Gemfile:
...and via the AF CLI: ...并通过AF CLI:
$ af push
[...creating/uploading/etc. etc... - removed to save space]
Staging Application 'chservice-dev': OK
Starting Application 'chservice-dev': .
Error: Application [chservice-dev] failed to start, logs information below.
====> /logs/staging.log <====
# Logfile created on 2013-06-27 20:22:23 +0000 by logger.rb/25413
Need to fetch tzinfo-1.0.1.gem from RubyGems
Adding tzinfo-1.0.1.gem to app...
Adding rufus-scheduler-2.0.19.gem to app...
Adding bundler-1.1.3.gem to app...
====> /logs/stdout.log <====
2013-06-27 20:22:28.841 - script executed.
Delete the application? [Yn]:
How can I fix (or troubleshoot) this? 我该如何解决(或排除故障)? I'm probably missing a large step/concept... very new to ruby =)
我可能错过了一个大步骤/概念...对于ruby来说是很新的=)
Thanks in advance. 提前致谢。
I think the app might be exiting immediately. 我认为该应用可能会立即退出。 The scheduler needs to be joined to the main thread in order to keep that app running.
调度程序需要连接到主线程,以保持该应用程序运行。
require 'rubygems'
require 'rufus/scheduler'
scheduler = Rufus::Scheduler.start_new
scheduler.every '10s' do
puts 'Log this'
end
### join the scheduler to the main thread ###
scheduler.join
I created a sample rufus scheduler app that works on appfog: https://github.com/tsantef/appfog-rufus-example 我创建了一个可在appfog上运行的rufus Scheduler示例应用程序: https : //github.com/tsantef/appfog-rufus-example
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.