hectcastro / chef-statsd

A Chef cookbook to install StatsD.
Apache License 2.0
38 stars 50 forks source link

Delete this little comma? #8

Closed nelsonjchen closed 11 years ago

nelsonjchen commented 11 years ago

If I don't delete this little comma at the end, I get this error:

[2013-01-25T16:49:43-08:00] INFO: *** Chef 10.18.2 ***
[2013-01-25T16:49:43-08:00] INFO: Setting the run_list to ["recipe[sr-statsd::default]", "recipe[statsd]"] from JSON
[2013-01-25T16:49:43-08:00] INFO: Run List is [recipe[sr-statsd::default], recipe[statsd]]
[2013-01-25T16:49:43-08:00] INFO: Run List expands to [sr-statsd::default, statsd]
[2013-01-25T16:49:43-08:00] INFO: Starting Chef Run for sr-statsd-berkshelf
[2013-01-25T16:49:43-08:00] INFO: Running start handlers
[2013-01-25T16:49:43-08:00] INFO: Start handlers complete.

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

Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/statsd/recipes/default.rb

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

SyntaxError

-----------

compile error
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/statsd/recipes/default.rb:45: syntax error, unexpected ')'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/statsd/recipes/default.rb:77: syntax error, unexpected $end, expecting kEND

Cookbook Trace:

---------------

  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/statsd/recipes/default.rb:77:in `from_file'

Relevant File Content:

----------------------

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/statsd/recipes/default.rb:

 70:      if node["platform_version"].to_f >= 9.10
 71:        provider Chef::Provider::Service::Upstart
 72:      end
 73:      #restart_command "sudo service statsd stop && sudo service statsd start"
 74:    end
 75:    action [ :enable, :start ]
 76:    supports :start => true, :stop => true, :restart => true, :status => true
 77>> end
 78:  

[2013-01-25T16:49:43-08:00] ERROR: Running exception handlers
[2013-01-25T16:49:43-08:00] ERROR: Exception handlers complete
[2013-01-25T16:49:43-08:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-01-25T16:49:43-08:00] FATAL: SyntaxError: compile error
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/statsd/recipes/default.rb:45: syntax error, unexpected ')'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/statsd/recipes/default.rb:77: syntax error, unexpected $end, expecting kEND
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

To be honest, I'm not sure what this did. Can some light be shed on this? I'm running the receipe from Berkshelf with a standard Vagrant precise64 image.

hectcastro commented 11 years ago

Not sure of exactly what is going on here, but I'm fine with merging this to remove the comma. If you're confident you didn't make any changes to the recipes, I recommend to mention this in #chef in case it's a regression in 10.18.2.

nelsonjchen commented 11 years ago

It didn't work in chef 10.14.x with the original vagrant box. Is that comma allowed in ruby 1.9+?

hectcastro commented 11 years ago

As far as I know it should:

irb(main):001:0> RUBY_VERSION
=> "1.9.3"
irb(main):002:0> File.join("test","test2",)
=> "test/test2"
nelsonjchen commented 11 years ago
irb(main):001:0> RUBY_VERSION
=> "1.8.7"
irb(main):002:0> File.join("test","test2",)
SyntaxError: compile error
(irb):2: syntax error, unexpected ')'
    from (irb):2
irb(main):003:0> 

Well, that answers my question then. Thanks!

hectcastro commented 11 years ago

No problem. Might be a good idea to install Chef using the Omnibus installer because it bundles a known working build of Ruby: http://opscode.com/chef/install