我在让工作守护程序正常工作时遇到问题。当我运行时:
ruby script/workling_client run
守护进程开始加载rails,但无限期地挂起。当我终止进程时,堆栈跟踪总是相同的:
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/core_ext/load_error.rb:32:in `new': Interrupt
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /Library/Ruby/Gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:68
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
... 81 levels...
from /Library/Ruby/Gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `call'
from /Library/Ruby/Gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `catch_exceptions'
from /Library/Ruby/Gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:138:in `run'
from script/workling_client:18
如果我在没有守护程序库的情况下运行脚本,它会按预期工作。事实上,我在使用守护进程 gem 加载任何需要我的 rails 环境的东西时遇到了麻烦。有任何想法吗?
更新: workling_client 将 worklings listen.rb 作为守护进程加载。我没有在listen.rb中加载rails,而是对其进行了更改,以便将其加载到workling_client中,并且该过程可以顺利进行。因此,我无法在守护脚本中加载 rails 是有原因的 :-(