Delete this little comma? #8

Merged
merged 1 commit into from Jan 26, 2013

Conversation

Projects
None yet
2 participants
Contributor

nelsonjchen commented Jan 26, 2013

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.

Update recipes/default.rb
delete this little comma at the end

hectcastro added a commit that referenced this pull request Jan 26, 2013

Merge pull request #8 from crazysim/master
Delete this little comma?

@hectcastro hectcastro merged commit 0f205af into hectcastro:master Jan 26, 2013

1 check passed

default The Travis build passed
Details
Owner

hectcastro commented Jan 26, 2013

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.

Contributor

nelsonjchen commented Jan 26, 2013

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

Owner

hectcastro commented Jan 26, 2013

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"
Contributor

nelsonjchen commented Jan 26, 2013

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!

Owner

hectcastro commented Jan 26, 2013

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

fredrick pushed a commit to Dwolla/chef-statsd that referenced this pull request Jul 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment