[chef] Re: No resource found for bundler. Tried application_bundler, application_ruby_bundler


Chronological Thread 
  • From: Andrea Campi < >
  • To: " " < >
  • Subject: [chef] Re: No resource found for bundler. Tried application_bundler, application_ruby_bundler
  • Date: Sat, 19 Jan 2013 12:29:50 +0100

bundler and precompile_assets are attributes of the rails sub-resource, so you want:

application "myapp" do
  …
  rails do
    …
    bundler true
    precompile_assets true
  end
end
 
Andrea



On Sat, Jan 19, 2013 at 12:24 PM, Sachin Sagar Rai < " target="_blank"> > wrote:

I'm using the new application_ruby cookbook to deploy a rails app.
Following is the experimental recipe:

gem_package "bundler"

application "myapp" do
  path "/var/www/rails_apps/myapp"
  owner "ubuntu"
  group "admin"
  bundler true
  revision "master"
  precompile_assets true
  rails do
    database do
      database "myapp_prod"
      username "myapp"
      password "sekret"
    end
    database_master_role "myapp_database_master"
  end
  unicorn do
    bundler true
  end
  nginx_load_balancer do
    only_if { node['roles'].include?('myapp_load_balancer') }
  end
end

THis is the error:

NameError
---------
No resource found for bundler. Tried application_bundler, application_ruby_bundler, application_nginx_bundler, bundler

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/application/resources/default.rb:121:in `method_missing'
  /var/chef/cache/cookbooks/myapp/recipes/default.rb:14:in `block in from_file'
  /var/chef/cache/cookbooks/myapp/recipes/default.rb:10:in `from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/application/resources/default.rb:

114:        if e.name == resource_name.to_sym || e.inspect =~ /\b#{resource_name}\b/
115:          next
116:        else
117:          raise e
118:        end
119:      end
120:    end
121>>   raise NameError, "No resource found for #{name}. Tried #{lookup_path.join(', ')}" unless resource
122:    # Enforce action :nothing in case people forget
123:    resource.action :nothing
124:    # Make this a weakref to prevent a cycle between the application resource and the sub resources
125:    resource.application WeakRef.new(self)
126:    resource.type name
127:   << resource
128:    resource
129:  end
130:  

[2013-01-19T16:59:15+05:45] ERROR: Running exception handlers
[2013-01-19T16:59:15+05:45] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[2013-01-19T16:59:15+05:45] ERROR: Exception handlers complete
[2013-01-19T16:59:16+05:45] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-01-19T16:59:16+05:45] FATAL: NameError: No resource found for bundler. Tried application_bundler, application_ruby_bundler, application_nginx_bundler, bundler


-------------------------------------------
@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
Sent with Sparrow





Archive powered by MHonArc 2.6.16.

§