【发布时间】:2014-11-25 19:01:31
【问题描述】:
我正在尝试使用从 AWS 获得的 opsworks 配方部署我的 rails 应用程序。我试图通过引用博客here 来设置整个事情。无论他说的是“php”还是“php-app”,我都用“rails”和我的应用程序名称替换。
我的应用角色 JSON 如下所示 -
{
"name": "hercules",
"description": "OpsWorks recipe run-list for the rails app layer",
"app_type": "rails",
"default_attributes": {
"max_pool_size": 5
},
"run_list": [
"recipe[opsworks_initial_setup]",
"recipe[dependencies]",
"recipe[unicorn::rails]",
"recipe[rails::configure]",
"recipe[deploy::default]",
"recipe[deploy::rails]"
],
"chef_type": "role",
"json_class": "Chef::Role"
}
当我尝试部署时,它可以很好地运行其他配方,并卡在 deploy::rails 的此错误上 -
==> app: ================================================================================
==> app: Recipe Compile Error in /tmp/vagrant-chef-3/chef-solo-1/cookbooks/deploy/recipes/rails.rb
==> app: ================================================================================
==> app:
==> app:
==> app: NoMethodError
==> app: -------------
==> app: No resource or method named opsworks_deploy' forChef::Recipe "rails"'
==> app:
==> app:
==> app: Cookbook Trace:
==> app: ---------------
==> app: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/deploy/recipes/rails.rb:20:in block in from_file'
==> app: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/deploy/recipes/rails.rb:2:ineach'
==> app: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/deploy/recipes/rails.rb:2:in `from_file'
==> app:
如果我打开rails.rb:20,那个功能就在那里——
opsworks_deploy do
Chef::Log.info("****** hi there *")
Chef::Log.info("#{application}")
Chef::Log.info(deploy.inspect)
app application
deploy_data deploy
end
我在这里错过了什么非常愚蠢的东西吗?
【问题讨论】:
-
那条线是什么样子的?另外值得注意的是,大多数 Opsworks 说明书不会在 Opsworks 之外运行,因为它们希望 AWS 填写数据。
-
@coderanger,你问的是哪一行?该文件
rails.rb在那里有行和函数定义。更新了 OP 以反映这一点。
标签: ruby-on-rails amazon-web-services chef-infra aws-opsworks