2013-06-27 4 views
1

ruby에서 AppFog guide on creating a background worker을 따르려고하고 있으며 일부 문제 (아마도 멍청한 놈)에 직면 해 있습니다. 이 예제에서는 Rufus-scheduler을 사용합니다. 이는 (the Ruby docs on AppFog에 따라) 을 사용해야 내 앱에 포함/관리해야 함을 의미합니다. 그럼에도 불구하고 나는 bundle install을 실행하여 AppFog에 적절한 ('독립 실행 형') 방식으로 모든 것을 푸시했지만 여전히 실행되지 않는 것처럼 보입니다.AppFog 백그라운드 작업자가 '시작하지 못했습니다.'

내 앱 & Gemfile : enter image description here

... 그리고 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]: 

내가 고칠 수있는 방법 (또는 문제 해결)이? 아마도 큰 단계/개념이 빠졌을 것입니다 ... 루비에 새롭다 =)

미리 감사드립니다.

답변

2

앱이 즉시 종료 될 수 있습니다. 해당 응용 프로그램을 계속 실행하려면 스케줄러를 주 스레드에 조인해야합니다. https://github.com/tsantef/appfog-rufus-example

:

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 

나는 appfog에서 작동 샘플 루퍼스 스케줄러 응용 프로그램을 만들어

관련 문제