0

我几乎找不到这方面的文档,也找不到EngineYard的任何帮助。

这是我的 delay_job/recipes/default.rb :

if ['solo', 'app', 'app_master'].include?(node[:instance_role])

  # be sure to replace "app_name" with the name of your application.
  run_for_app("HQ_Channel2") do |app_name, data|

    # this is something trip added. beware.
    worker_count = 3

    worker_count.times do |count|
      template "/etc/monit.d/delayed_job#{count+1}.#{app_name}.monitrc" do
        source "delayed_job_worker.monitrc.erb"
        owner "root"
        group "root"
        mode 0644
        variables({
          :app_name => app_name,
          :user => node[:owner_name],
          :worker_name => "delayed_job#{count+1}",
          :framework_env => node[:environment][:framework_env]
        })
      end
    end

    # this is something trip removed. beware.
    #worker_name = "delayed_job"

    # The symlink is created in /data/app_name/current/tmp/pids -> /data/app_name/shared/pids, but shared/pids doesn't seem to be?
    directory "/data/#{app_name}/shared/pids" do
      owner node[:owner_name]
      group node[:owner_name]
      mode 0755
    end

    template "/etc/monit.d/delayed_job_worker.#{app_name}.monitrc" do
      source "delayed_job_worker.monitrc.erb"
      #owner node[:owner_name]
      #group node[:owner_name]
      owner "root"
      group "root"
      mode 0644
      variables({
        :app_name => app_name,
        :user => node[:owner_name],
        :worker_name => worker_name,
        :framework_env => node[:environment][:framework_env]
      })
    end

    bash "monit-reload-restart" do
       user "root"
       code "monit reload && monit"
    end

  end


end

然后我做 ey-recipes upload -e production && ey-recipes apply -e production。

一切都会过去。

但是当我部署 -e 生产时,我得到一个

Beginning deploy for 'HQ_Channel2' in 'production' on server...
Application master's status is not "running" (green); it is "error".

我检查了我的自定义日志并返回:

[Thu, 01 Dec 2011 06:07:17 -0800] INFO: Starting Chef Solo Run
/usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/chef-0.6.0.2/lib/chef/recipe.rb:196:in `method_missing': Cannot find Chef::Resource::Template for template (NameError)

为什么我会收到此错误?

4

1 回答 1

0

看看这个答案(由其他人撰写)。

https://gist.github.com/334674

于 2011-12-12T14:08:07.083 回答