Https://github.com/opscode-cookbooks/application


#1

I am trying to learn how to use the applications cookbook. Appreciate any pointers/specific guidance on getting setting up rails in vagrant box using that cookbook or on using the examples here in

https://github.com/opscode-cookbooks/application/tree/master/examples


#2

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:

https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too:

Have a look at its README, create your recipe similar to the examples in
the application_ruby README, and you should be 90% of the way, unless you
have some special needs.


#3

I recently built an ecommerce site for a clothing company [1] I founded
with my twin: rails, the application / application_ruby cookbooks, and a 40
line recipe… configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more
documentation, but work great. It will also be less confusing when the old
versions are fully deprecated. Let the list know if you have trouble.

James

[1] www.fromholden.com &
http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a
flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi
andrea.campi@zephirworks.comwrote:

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:

https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too:
https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in
the application_ruby README, and you should be 90% of the way, unless you
have some special needs.


#4

Would you feel comfortable sharing a public facing version of that 40 line recipe?

On Nov 10, 2012, at 3:12 PM, James js@aegisco.com wrote:

I recently built an ecommerce site for a clothing company [1] I founded with my twin: rails, the application / application_ruby cookbooks, and a 40 line recipe… configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more documentation, but work great. It will also be less confusing when the old versions are fully deprecated. Let the list know if you have trouble.

James

[1] www.fromholden.com & http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi andrea.campi@zephirworks.com wrote:

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:

https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too: https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in the application_ruby README, and you should be 90% of the way, unless you have some special needs.


#5

Sure! https://gist.github.com/d0dbbab5af4e3a7c9c43

I did have a bit of trouble with paths in the runit template using Omnibus,
but I also had trouble with postgres and Omnibus, so I decided to use
system ruby 1.9.3 and skip Omnibus for this project. If you don’t need
pg/postgres, and you want to use Omnibus, make sure you get the patch to
application_ruby to add bundler_command [1].

User and group are both required [2], which should be cleaned up a bit.
This should be specified in the docs, or there should be logic to deal with
both cases.

Your deploy key and database password should probably go in an encrypted
databag [3], but if you’re just testing, you can make these strings.

James

[1]


[2]
https://github.com/opscode-cookbooks/application_ruby/blob/master/templates/default/sv-unicorn-run.erb#L6
[3] http://wiki.opscode.com/display/chef/Encrypted+Data+Bags

On Sat, Nov 10, 2012 at 3:43 PM, Nilesh lvnilesh@yahoo.com wrote:

Would you feel comfortable sharing a public facing version of that 40 line
recipe?

On Nov 10, 2012, at 3:12 PM, James js@aegisco.com wrote:

I recently built an ecommerce site for a clothing company [1] I founded
with my twin: rails, the application / application_ruby cookbooks, and a 40
line recipe… configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more
documentation, but work great. It will also be less confusing when the old
versions are fully deprecated. Let the list know if you have trouble.

James

[1] www.fromholden.com &
http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a
flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi <
andrea.campi@zephirworks.com> wrote:

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:

https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too:
https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in
the application_ruby README, and you should be 90% of the way, unless you
have some special needs.


#6

Thanks for the gist.

I used it my my sample rails app. It seems to checkout from github correctly using key I provided, succeeded in copying to /var/www/ and then attempts a bundle install and fails :frowning:

[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] copied the cached checkout to /var/www/releases/56176387b70062bf1990c53d08b8eae65f5b9d49
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set user to vagrant
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set group to vagrant
[2012-11-11T03:51:47+00:00] INFO: Processing application_ruby_rails[myapp] action before_migrate (myapp::default line 110)
[2012-11-11T03:51:47+00:00] INFO: Running bundle install

================================================================================
Error executing action before_migrate on resource ‘application_ruby_rails[myapp]’

ArgumentError

wrong number of arguments (1 for 2)

chef-stacktrace.out follows:
Generated at Sun Nov 11 03:51:47 +0000 2012
ArgumentError: deploy_revision[myapp] (/vagrant/cookbooks/application/providers/default.rb line 122) had an error: ArgumentError: application_ruby_rails[myapp] (myapp::default line 110) had an error: ArgumentError: wrong number of arguments (1 for 2)
/vagrant/cookbooks/application/libraries/default.rb:138:in provider_for_resource' /vagrant/cookbooks/application/libraries/default.rb:138:indeploy_provider’
/vagrant/cookbooks/application/libraries/default.rb:145:in release_path' /vagrant/cookbooks/application/resources/default.rb:89:inrelease_path’
/vagrant/cookbooks/application/libraries/default.rb:70:in send' /vagrant/cookbooks/application/libraries/default.rb:70:inmethod_missing’
/vagrant/cookbooks/application_ruby/providers/rails.rb:63:in class_from_file' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:207:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:207:in action_before_migrate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:123:insend’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:123:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/vagrant/cookbooks/application/providers/default.rb:179:in run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:176:ineach’
/vagrant/cookbooks/application/providers/default.rb:176:in run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:161:insend’
/vagrant/cookbooks/application/providers/default.rb:161:in run_deploy' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:174:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:174:in recipe_eval' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:63:in converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:ineach’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:61:in converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:136:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:125:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:49:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:81:in each' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:94:in execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in call_iterator_block' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in iterate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:92:in execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:378:in converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:indo_run’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:176:in run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application/solo.rb:218:in loop' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application.rb:70:in run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25 /opt/vagrant_ruby/bin/chef-solo:19:inload’
/opt/vagrant_ruby/bin/chef-solo:19

On Nov 10, 2012, at 4:20 PM, James js@aegisco.com wrote:

Sure! https://gist.github.com/d0dbbab5af4e3a7c9c43

I did have a bit of trouble with paths in the runit template using Omnibus, but I also had trouble with postgres and Omnibus, so I decided to use system ruby 1.9.3 and skip Omnibus for this project. If you don’t need pg/postgres, and you want to use Omnibus, make sure you get the patch to application_ruby to add bundler_command [1].

User and group are both required [2], which should be cleaned up a bit. This should be specified in the docs, or there should be logic to deal with both cases.

Your deploy key and database password should probably go in an encrypted databag [3], but if you’re just testing, you can make these strings.

James

[1] https://github.com/opscode-cookbooks/application_ruby/commit/6c16ae0b3c2e94bbc789f7ef9bb63ccf59466718
[2] https://github.com/opscode-cookbooks/application_ruby/blob/master/templates/default/sv-unicorn-run.erb#L6
[3] http://wiki.opscode.com/display/chef/Encrypted+Data+Bags

On Sat, Nov 10, 2012 at 3:43 PM, Nilesh lvnilesh@yahoo.com wrote:
Would you feel comfortable sharing a public facing version of that 40 line recipe?

On Nov 10, 2012, at 3:12 PM, James js@aegisco.com wrote:

I recently built an ecommerce site for a clothing company [1] I founded with my twin: rails, the application / application_ruby cookbooks, and a 40 line recipe… configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more documentation, but work great. It will also be less confusing when the old versions are fully deprecated. Let the list know if you have trouble.

James

[1] www.fromholden.com & http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi andrea.campi@zephirworks.com wrote:

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:
https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too: https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in the application_ruby README, and you should be 90% of the way, unless you have some special needs.


#7

There are a couple of known issue with Chef >= 10.14; you are using 10.14.2
which is worse than 10.14.4.

There is a pull request to fix those problems, you can try getting the
cookbook from my branch:


That should fix it; if it doesn’t, I’d like to hear it.

On Sun, Nov 11, 2012 at 5:08 AM, Nilesh lvnilesh@yahoo.com wrote:

Thanks for the gist.

I used it my my sample rails app. It seems to checkout from github
correctly using key I provided, succeeded in copying to /var/www/ and then
attempts a bundle install and fails :frowning:

[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] copied the cached
checkout to /var/www/releases/56176387b70062bf1990c53d08b8eae65f5b9d49
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set user to
vagrant
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set group to
vagrant
[2012-11-11T03:51:47+00:00] INFO: Processing application_ruby_rails[myapp]
action before_migrate (myapp::default line 110)
[2012-11-11T03:51:47+00:00] INFO: Running bundle install

================================================================================
Error executing action before_migrate on resource
’application_ruby_rails[myapp]’

================================================================================

ArgumentError

wrong number of arguments (1 for 2)

chef-stacktrace.out follows:
Generated at Sun Nov 11 03:51:47 +0000 2012
ArgumentError: deploy_revision[myapp]
(/vagrant/cookbooks/application/providers/default.rb line 122) had an
error: ArgumentError: application_ruby_rails[myapp] (myapp::default line
110) had an error: ArgumentError: wrong number of arguments (1 for 2)
/vagrant/cookbooks/application/libraries/default.rb:138:in
provider_for_resource' /vagrant/cookbooks/application/libraries/default.rb:138:indeploy_provider’
/vagrant/cookbooks/application/libraries/default.rb:145:in release_path' /vagrant/cookbooks/application/resources/default.rb:89:inrelease_path’
/vagrant/cookbooks/application/libraries/default.rb:70:in send' /vagrant/cookbooks/application/libraries/default.rb:70:inmethod_missing’
/vagrant/cookbooks/application_ruby/providers/rails.rb:63:in
class_from_file' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:207:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:207:in
action_before_migrate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:123:insend’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:123:in
run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/vagrant/cookbooks/application/providers/default.rb:179:in
run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:176:ineach’
/vagrant/cookbooks/application/providers/default.rb:176:in
run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:161:insend’
/vagrant/cookbooks/application/providers/default.rb:161:in run_deploy' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:174:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:174:in
recipe_eval' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:63:in
converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:ineach’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:61:in
converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:136:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:125:in
run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:49:in
run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:81:in
each' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:94:in
execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
call_iterator_block' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
iterate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:378:in
converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:indo_run’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:176:in
run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application/solo.rb:218:in
loop' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application.rb:70:in
run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25 /opt/vagrant_ruby/bin/chef-solo:19:inload’
/opt/vagrant_ruby/bin/chef-solo:19

On Nov 10, 2012, at 4:20 PM, James js@aegisco.com wrote:

Sure! https://gist.github.com/d0dbbab5af4e3a7c9c43

I did have a bit of trouble with paths in the runit template using
Omnibus, but I also had trouble with postgres and Omnibus, so I decided to
use system ruby 1.9.3 and skip Omnibus for this project. If you don’t need
pg/postgres, and you want to use Omnibus, make sure you get the patch to
application_ruby to add bundler_command [1].

User and group are both required [2], which should be cleaned up a bit.
This should be specified in the docs, or there should be logic to deal with
both cases.

Your deploy key and database password should probably go in an encrypted
databag [3], but if you’re just testing, you can make these strings.

James

[1]
https://github.com/opscode-cookbooks/application_ruby/commit/6c16ae0b3c2e94bbc789f7ef9bb63ccf59466718
[2]
https://github.com/opscode-cookbooks/application_ruby/blob/master/templates/default/sv-unicorn-run.erb#L6
[3] http://wiki.opscode.com/display/chef/Encrypted+Data+Bags

On Sat, Nov 10, 2012 at 3:43 PM, Nilesh lvnilesh@yahoo.com wrote:

Would you feel comfortable sharing a public facing version of that 40
line recipe?

On Nov 10, 2012, at 3:12 PM, James js@aegisco.com wrote:

I recently built an ecommerce site for a clothing company [1] I founded
with my twin: rails, the application / application_ruby cookbooks, and a 40
line recipe… configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more
documentation, but work great. It will also be less confusing when the old
versions are fully deprecated. Let the list know if you have trouble.

James

[1] www.fromholden.com &
http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a
flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi <
andrea.campi@zephirworks.com> wrote:

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:

https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too:
https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in
the application_ruby README, and you should be 90% of the way, unless you
have some special needs.


#8

Thanks. I updated chef to 10.16.2 and ran chef again. I see some deprecation warnings re: chef 11 https://gist.github.com/4055431 and then it failed looking for sqlite-dev so I sudo apt-get install sqlite3 libsqlite3-dev and ran again. This time it failed with this message. No such file or directory - /etc/init.d/myapp hup - https://gist.github.com/4055440

On Nov 11, 2012, at 1:33 AM, Andrea Campi andrea.campi@zephirworks.com wrote:

There are a couple of known issue with Chef >= 10.14; you are using 10.14.2 which is worse than 10.14.4.

There is a pull request to fix those problems, you can try getting the cookbook from my branch: https://github.com/andreacampi/application/tree/COOK-1673
That should fix it; if it doesn’t, I’d like to hear it.

On Sun, Nov 11, 2012 at 5:08 AM, Nilesh lvnilesh@yahoo.com wrote:
Thanks for the gist.

I used it my my sample rails app. It seems to checkout from github correctly using key I provided, succeeded in copying to /var/www/ and then attempts a bundle install and fails :frowning:

[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] copied the cached checkout to /var/www/releases/56176387b70062bf1990c53d08b8eae65f5b9d49
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set user to vagrant
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set group to vagrant
[2012-11-11T03:51:47+00:00] INFO: Processing application_ruby_rails[myapp] action before_migrate (myapp::default line 110)
[2012-11-11T03:51:47+00:00] INFO: Running bundle install

================================================================================
Error executing action before_migrate on resource ‘application_ruby_rails[myapp]’

ArgumentError

wrong number of arguments (1 for 2)

chef-stacktrace.out follows:
Generated at Sun Nov 11 03:51:47 +0000 2012
ArgumentError: deploy_revision[myapp] (/vagrant/cookbooks/application/providers/default.rb line 122) had an error: ArgumentError: application_ruby_rails[myapp] (myapp::default line 110) had an error: ArgumentError: wrong number of arguments (1 for 2)
/vagrant/cookbooks/application/libraries/default.rb:138:in provider_for_resource' /vagrant/cookbooks/application/libraries/default.rb:138:indeploy_provider’
/vagrant/cookbooks/application/libraries/default.rb:145:in release_path' /vagrant/cookbooks/application/resources/default.rb:89:inrelease_path’
/vagrant/cookbooks/application/libraries/default.rb:70:in send' /vagrant/cookbooks/application/libraries/default.rb:70:inmethod_missing’
/vagrant/cookbooks/application_ruby/providers/rails.rb:63:in class_from_file' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:207:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:207:in action_before_migrate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:123:insend’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:123:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/vagrant/cookbooks/application/providers/default.rb:179:in run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:176:ineach’
/vagrant/cookbooks/application/providers/default.rb:176:in run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:161:insend’
/vagrant/cookbooks/application/providers/default.rb:161:in run_deploy' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:174:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:174:in recipe_eval' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:63:in converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:ineach’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:61:in converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:136:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:125:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:49:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:81:in each' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:94:in execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in call_iterator_block' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in iterate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:92:in execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:378:in converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:indo_run’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:176:in run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application/solo.rb:218:in loop' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application.rb:70:in run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25 /opt/vagrant_ruby/bin/chef-solo:19:inload’
/opt/vagrant_ruby/bin/chef-solo:19

On Nov 10, 2012, at 4:20 PM, James js@aegisco.com wrote:

Sure! https://gist.github.com/d0dbbab5af4e3a7c9c43

I did have a bit of trouble with paths in the runit template using Omnibus, but I also had trouble with postgres and Omnibus, so I decided to use system ruby 1.9.3 and skip Omnibus for this project. If you don’t need pg/postgres, and you want to use Omnibus, make sure you get the patch to application_ruby to add bundler_command [1].

User and group are both required [2], which should be cleaned up a bit. This should be specified in the docs, or there should be logic to deal with both cases.

Your deploy key and database password should probably go in an encrypted databag [3], but if you’re just testing, you can make these strings.

James

[1] https://github.com/opscode-cookbooks/application_ruby/commit/6c16ae0b3c2e94bbc789f7ef9bb63ccf59466718
[2] https://github.com/opscode-cookbooks/application_ruby/blob/master/templates/default/sv-unicorn-run.erb#L6
[3] http://wiki.opscode.com/display/chef/Encrypted+Data+Bags

On Sat, Nov 10, 2012 at 3:43 PM, Nilesh lvnilesh@yahoo.com wrote:
Would you feel comfortable sharing a public facing version of that 40 line recipe?

On Nov 10, 2012, at 3:12 PM, James js@aegisco.com wrote:

I recently built an ecommerce site for a clothing company [1] I founded with my twin: rails, the application / application_ruby cookbooks, and a 40 line recipe… configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more documentation, but work great. It will also be less confusing when the old versions are fully deprecated. Let the list know if you have trouble.

James

[1] www.fromholden.com & http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi andrea.campi@zephirworks.com wrote:

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:
https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too: https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in the application_ruby README, and you should be 90% of the way, unless you have some special needs.


#9

I created another vagrant box --no-provision first, vagrant ssh and then updated gem to 10.16.2 and also added missing sqlite3-dev and then ran chef to this get https://gist.github.com/4055469

It would really help to have at least 1 complete working example using application and application_ruby.

On Nov 11, 2012, at 8:32 AM, Nilesh lvnilesh@yahoo.com wrote:

Thanks. I updated chef to 10.16.2 and ran chef again. I see some deprecation warnings re: chef 11 https://gist.github.com/4055431 and then it failed looking for sqlite-dev so I sudo apt-get install sqlite3 libsqlite3-dev and ran again. This time it failed with this message. No such file or directory - /etc/init.d/myapp hup - https://gist.github.com/4055440

On Nov 11, 2012, at 1:33 AM, Andrea Campi andrea.campi@zephirworks.com wrote:

There are a couple of known issue with Chef >= 10.14; you are using 10.14.2 which is worse than 10.14.4.

There is a pull request to fix those problems, you can try getting the cookbook from my branch: https://github.com/andreacampi/application/tree/COOK-1673
That should fix it; if it doesn’t, I’d like to hear it.

On Sun, Nov 11, 2012 at 5:08 AM, Nilesh lvnilesh@yahoo.com wrote:
Thanks for the gist.

I used it my my sample rails app. It seems to checkout from github correctly using key I provided, succeeded in copying to /var/www/ and then attempts a bundle install and fails :frowning:

[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] copied the cached checkout to /var/www/releases/56176387b70062bf1990c53d08b8eae65f5b9d49
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set user to vagrant
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set group to vagrant
[2012-11-11T03:51:47+00:00] INFO: Processing application_ruby_rails[myapp] action before_migrate (myapp::default line 110)
[2012-11-11T03:51:47+00:00] INFO: Running bundle install

================================================================================
Error executing action before_migrate on resource ‘application_ruby_rails[myapp]’

ArgumentError

wrong number of arguments (1 for 2)

chef-stacktrace.out follows:
Generated at Sun Nov 11 03:51:47 +0000 2012
ArgumentError: deploy_revision[myapp] (/vagrant/cookbooks/application/providers/default.rb line 122) had an error: ArgumentError: application_ruby_rails[myapp] (myapp::default line 110) had an error: ArgumentError: wrong number of arguments (1 for 2)
/vagrant/cookbooks/application/libraries/default.rb:138:in provider_for_resource' /vagrant/cookbooks/application/libraries/default.rb:138:indeploy_provider’
/vagrant/cookbooks/application/libraries/default.rb:145:in release_path' /vagrant/cookbooks/application/resources/default.rb:89:inrelease_path’
/vagrant/cookbooks/application/libraries/default.rb:70:in send' /vagrant/cookbooks/application/libraries/default.rb:70:inmethod_missing’
/vagrant/cookbooks/application_ruby/providers/rails.rb:63:in class_from_file' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:207:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:207:in action_before_migrate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:123:insend’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:123:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/vagrant/cookbooks/application/providers/default.rb:179:in run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:176:ineach’
/vagrant/cookbooks/application/providers/default.rb:176:in run_actions_with_context' /vagrant/cookbooks/application/providers/default.rb:161:insend’
/vagrant/cookbooks/application/providers/default.rb:161:in run_deploy' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:174:ininstance_eval’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:174:in recipe_eval' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:63:in converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:ineach’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/mixin/why_run.rb:61:in converge!' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:136:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/provider.rb:125:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:inrun_action’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:49:in run_action' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/runner.rb:81:in each' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:94:in execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in call_iterator_block' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in iterate' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/resource_collection.rb:92:in execute_each_resource' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:inconverge’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:378:in converge' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:indo_run’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/client.rb:176:in run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application/solo.rb:218:in loop' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:inrun_application’
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/…/lib/chef/application.rb:70:in run' /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25 /opt/vagrant_ruby/bin/chef-solo:19:inload’
/opt/vagrant_ruby/bin/chef-solo:19

On Nov 10, 2012, at 4:20 PM, James js@aegisco.com wrote:

Sure! https://gist.github.com/d0dbbab5af4e3a7c9c43

I did have a bit of trouble with paths in the runit template using Omnibus, but I also had trouble with postgres and Omnibus, so I decided to use system ruby 1.9.3 and skip Omnibus for this project. If you don’t need pg/postgres, and you want to use Omnibus, make sure you get the patch to application_ruby to add bundler_command [1].

User and group are both required [2], which should be cleaned up a bit. This should be specified in the docs, or there should be logic to deal with both cases.

Your deploy key and database password should probably go in an encrypted databag [3], but if you’re just testing, you can make these strings.

James

[1] https://github.com/opscode-cookbooks/application_ruby/commit/6c16ae0b3c2e94bbc789f7ef9bb63ccf59466718
[2] https://github.com/opscode-cookbooks/application_ruby/blob/master/templates/default/sv-unicorn-run.erb#L6
[3] http://wiki.opscode.com/display/chef/Encrypted+Data+Bags

On Sat, Nov 10, 2012 at 3:43 PM, Nilesh lvnilesh@yahoo.com wrote:
Would you feel comfortable sharing a public facing version of that 40 line recipe?

On Nov 10, 2012, at 3:12 PM, James js@aegisco.com wrote:

I recently built an ecommerce site for a clothing company [1] I founded with my twin: rails, the application / application_ruby cookbooks, and a 40 line recipe… configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more documentation, but work great. It will also be less confusing when the old versions are fully deprecated. Let the list know if you have trouble.

James

[1] www.fromholden.com & http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi andrea.campi@zephirworks.com wrote:

On Sat, Nov 10, 2012 at 9:58 PM, Nilesh lvnilesh@yahoo.com wrote:
https://github.com/opscode-cookbooks/application/tree/master/examples

To run rails apps with it, look at its sibling too: https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in the application_ruby README, and you should be 90% of the way, unless you have some special needs.


#10

On Sun, Nov 11, 2012 at 5:45 PM, Nilesh lvnilesh@yahoo.com wrote:

I created another vagrant box --no-provision first, vagrant ssh and then
updated gem to 10.16.2 and also added missing sqlite3-dev and then ran chef
to this get https://gist.github.com/4055469

It would really help to have at least 1 complete working example using
application and application_ruby.

Of course you need to install sqlite3-dev yourself, how would the cookbook
know you need it?
Ditto for this error: your application is apparently missing a config/
directory. That directory is so customary in Rails, most tools I’ve seen
just expect it to be there.

There is no such thing as too much documentation, I agree—but you’re 95% of
the way there.
Everything that may be missing is going to be different between
applications, I’m afraid.

Fix those small problems and try again.


#11

Thanks. I am happy to note I am 95% of the way :slight_smile:

myapp is generic composed via rails new myapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T and available at https://github.com/lvnilesh/myapp

On Nov 11, 2012, at 10:21 AM, Andrea Campi andrea.campi@zephirworks.com wrote:

On Sun, Nov 11, 2012 at 5:45 PM, Nilesh lvnilesh@yahoo.com wrote:
I created another vagrant box --no-provision first, vagrant ssh and then updated gem to 10.16.2 and also added missing sqlite3-dev and then ran chef to this get https://gist.github.com/4055469

It would really help to have at least 1 complete working example using application and application_ruby.

Of course you need to install sqlite3-dev yourself, how would the cookbook know you need it?
Ditto for this error: your application is apparently missing a config/ directory. That directory is so customary in Rails, most tools I’ve seen just expect it to be there.

There is no such thing as too much documentation, I agree—but you’re 95% of the way there.
Everything that may be missing is going to be different between applications, I’m afraid.

Fix those small problems and try again.


#12

On Sun, Nov 11, 2012 at 7:34 PM, Nilesh lvnilesh@yahoo.com wrote:

Thanks. I am happy to note I am 95% of the way :slight_smile:

myapp is generic composed via rails new myapp -m
https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T and
available at https://github.com/lvnilesh/myapp

Uhm, ok, that’s odd.

The Chef run fails while creating a symlink from
/var/www/shared/database.yml to
/var/www/releases/0465c9e08a9f73ba248bf814e9c816599e75dd95/config/database.yml

The log shows /var/www/shared/database.yml was created, so either it’s
lying, or it can’t create the link in your target directory.
The former would be surprising and point to a bug somewhere—can you
confirm /var/www/shared/database.yml is indeed there?

Verifying the latter is a bit tricky because the deploy resource (which is
used under the hood) rolls back on error.

Add this to your application block: rollback_on_error true
*
*
*
*


#13

vagrant@precise64:~ cd /var/www/shared/ vagrant@precise64:/var/www/shared ls -la
total 12
drwxr-xr-x 2 vagrant vagrant 4096 Nov 11 19:12 .
drwxr-xr-x 3 vagrant vagrant 4096 Nov 11 19:12 …
-rw-r–r-- 1 vagrant vagrant 145 Nov 11 19:12 database.yml

here is log from another run on a fresh vagrant after chef update to 10.16.2

On Nov 11, 2012, at 10:55 AM, Andrea Campi andrea.campi@zephirworks.com wrote:

On Sun, Nov 11, 2012 at 7:34 PM, Nilesh lvnilesh@yahoo.com wrote:

Thanks. I am happy to note I am 95% of the way :slight_smile:

myapp is generic composed via rails new myapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T and available at https://github.com/lvnilesh/myapp

Uhm, ok, that’s odd.

The Chef run fails while creating a symlink from /var/www/shared/database.yml to /var/www/releases/0465c9e08a9f73ba248bf814e9c816599e75dd95/config/database.yml

The log shows /var/www/shared/database.yml was created, so either it’s lying, or it can’t create the link in your target directory.
The former would be surprising and point to a bug somewhere—can you confirm /var/www/shared/database.yml is indeed there?

Verifying the latter is a bit tricky because the deploy resource (which is used under the hood) rolls back on error.

Add this to your application block: rollback_on_error true


#14

Right, that’s one.

Try adding rollback_on_error per the previous email, and run it again.

Then look at

ls -la /var/www/releases/0465c9e08a9f73ba248bf814e9c816599e75dd95
/var/www/releases/0465c9e08a9f73ba248bf814e9c816599e75dd95/config


#15

Hi Andrea:

Thanks very much for your help. I am unable to spend further time on application/application_ruby this weekend.

PS: In the meanwhile, I found http://blog.119labs.com/2012/03/rails-vagrant-chef/ which seems to give me another point to start.

On Nov 11, 2012, at 11:25 AM, Andrea Campi andrea.campi@zephirworks.com wrote:

Right, that’s one.

Try adding rollback_on_error per the previous email, and run it again.

Then look at

ls -la /var/www/releases/0465c9e08a9f73ba248bf814e9c816599e75dd95 /var/www/releases/0465c9e08a9f73ba248bf814e9c816599e75dd95/config


#16

On Sunday, November 11, 2012 at 1:33 AM, Andrea Campi wrote:

There are a couple of known issue with Chef >= 10.14; you are using 10.14.2 which is worse than 10.14.4.

There is a pull request to fix those problems, you can try getting the cookbook from my branch: https://github.com/andreacampi/application/tree/COOK-1673
That should fix it; if it doesn’t, I’d like to hear it.

Andrea,
Do you have a moment to build a gem from the latest 10-stable and see if it resolves your issues? We applied some changes to the why-run internals that I think will fix the problem, but we’re super busy with Chef 11 stuff so I didn’t have the time to test your repro on http://tickets.opscode.com/browse/CHEF-3493

Thanks,


Daniel DeLeo


#17

I hear you, I’ve been very busy as well but it’s on my TODO. I’ll try to find some time ASAP

On Nov 11, 2012, at 9:46 PM, Daniel DeLeo dan@kallistec.com wrote:

On Sunday, November 11, 2012 at 1:33 AM, Andrea Campi wrote:

There are a couple of known issue with Chef >= 10.14; you are using 10.14.2 which is worse than 10.14.4.

There is a pull request to fix those problems, you can try getting the cookbook from my branch: https://github.com/andreacampi/application/tree/COOK-1673
That should fix it; if it doesn’t, I’d like to hear it.
Andrea,
Do you have a moment to build a gem from the latest 10-stable and see if it resolves your issues? We applied some changes to the why-run internals that I think will fix the problem, but we’re super busy with Chef 11 stuff so I didn’t have the time to test your repro on http://tickets.opscode.com/browse/CHEF-3493

Thanks,


Daniel DeLeo


#18

On Sunday, November 11, 2012 at 1:36 PM, Andrea Campi wrote:

I hear you, I’ve been very busy as well but it’s on my TODO. I’ll try to find some time ASAP

Cool, I didn’t know if the notification from Jira went in your spam folder or whatever. Thanks in advance.


Daniel DeLeo