-
Notifications
You must be signed in to change notification settings - Fork 128
Syntax error in definitions files #49
Comments
@joeypdx what version of Ruby and Chef are you using? This is currently working for me with the latest omnibus Chef install and chef-solo with Vagrant. This cookbook requires Ruby 1.9, 1.8 won't work. I will update the README with a note that reflects this. |
I also get this error using Ruby 1.9. |
@dvfabbri thanks for the report. What version of Chef and what version of Ruby are you using? I did update the syntax from 1.8-style to 1.9-style hashes between 0.11.3 and 0.12.0 of this cookbook, but I am currently using this in production in several places with Chef 11.4.4 and 11.6.0 via Ruby 1.9.3 without issue. Let me know, I'd like to help you debug this issue. Thanks. |
Chef 10.14.2 and ruby 1.9.3. Perhaps I need to update chef. I am just using On Thu, Sep 26, 2013 at 11:31 PM, Phil Cohen notifications@github.comwrote:
|
@dvfabbri thanks for the information. I have been using the Vagrant.require_plugin("vagrant-omnibus")
Vagrant.configure("2") do |config|
config.omnibus.chef_version = :latest
# ...
end If you get a chance, please give that a try an let me know how it turns out. I'm hoping this issue is just version related. If not, I'm happy to work to get it resolved. Thanks for your time and patience! |
So I unfortunately ran into this today using opsworks, and have come to find out that they bootstrap (and only support) with 1.8.7. So for now, I've forked and just reverted the 1.9.3 specific changes. I'll try and stay in sync with your upstream changes as long as possible ;) |
Saw the same issue with 2c412e2 I have omnibus set to Ran |
While using 0.12.0 in a recipe under Chef Solo, I encountered the following errors. These errors don't occur using 0.11.3.
Recipe Compile Error in /tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database.rb
SyntaxError
compile error
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database.rb:1: syntax error, unexpected ':', expecting $end
define :pg_database, action: :create do
^
Cookbook Trace:
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database.rb:1:in
from_file' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:207:in
load_resource_definitions'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:230:in
call' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:230:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:229:in
each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:229:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:227:in
each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:227:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:203:in
load_resource_definitions' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:66:in
load'/usr/lib/ruby/vendor_ruby/chef/client.rb:198:in
setup_run_context' /usr/lib/ruby/vendor_ruby/chef/client.rb:418:in
do_run'/usr/lib/ruby/vendor_ruby/chef/client.rb:176:in
run' /usr/lib/ruby/vendor_ruby/chef/application.rb:140:in
run_chef_client'/usr/lib/ruby/vendor_ruby/chef/application/solo.rb:224:in
run_application' /usr/lib/ruby/vendor_ruby/chef/application/solo.rb:216:in
loop'/usr/lib/ruby/vendor_ruby/chef/application/solo.rb:216:in
run_application' /usr/lib/ruby/vendor_ruby/chef/application.rb:72:in
run'/usr/bin/chef-solo:24
Relevant File Content:
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database.rb:
1>> define :pg_database, action: :create do
2:
3: defaults = {
4: user: "postgres",
5: username: nil,
6: host: nil,
7: port: nil,
8: encoding: "utf8",
9: locale: nil,
10: template: nil,
Recipe Compile Error in /tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database_extensions.rb
SyntaxError
compile error
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database_extensions.rb:1: syntax error, unexpected ':', expecting $end
define :pg_database_extensions, action: :create do
^
Cookbook Trace:
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database_extensions.rb:1:in
from_file' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:207:in
load_resource_definitions'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:230:in
call' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:230:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:229:in
each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:229:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:227:in
each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:227:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:203:in
load_resource_definitions' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:66:in
load'/usr/lib/ruby/vendor_ruby/chef/client.rb:198:in
setup_run_context' /usr/lib/ruby/vendor_ruby/chef/client.rb:418:in
do_run'/usr/lib/ruby/vendor_ruby/chef/client.rb:176:in
run' /usr/lib/ruby/vendor_ruby/chef/application.rb:140:in
run_chef_client'/usr/lib/ruby/vendor_ruby/chef/application/solo.rb:224:in
run_application' /usr/lib/ruby/vendor_ruby/chef/application/solo.rb:216:in
loop'/usr/lib/ruby/vendor_ruby/chef/application/solo.rb:216:in
run_application' /usr/lib/ruby/vendor_ruby/chef/application.rb:72:in
run'/usr/bin/chef-solo:24
Relevant File Content:
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_database_extensions.rb:
1>> define :pg_database_extensions, action: :create do
2:
3: dbname = params[:name]
4: languages = Array(params[:languages]) # Allow single value or array of values
5: extensions = Array(params[:extensions])
6: postgis = params[:postgis]
7:
8: case params[:action]
9: when :create
10:
Recipe Compile Error in /tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_user.rb
SyntaxError
compile error
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_user.rb:1: syntax error, unexpected ':', expecting $end
define :pg_user, action: :create do
^
Cookbook Trace:
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_user.rb:1:in
from_file' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:207:in
load_resource_definitions'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:230:in
call' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:230:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:229:in
each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:229:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:227:in
each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:227:in
foreach_cookbook_load_segment'/usr/lib/ruby/vendor_ruby/chef/run_context.rb:203:in
load_resource_definitions' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:66:in
load'/usr/lib/ruby/vendor_ruby/chef/client.rb:198:in
setup_run_context' /usr/lib/ruby/vendor_ruby/chef/client.rb:418:in
do_run'/usr/lib/ruby/vendor_ruby/chef/client.rb:176:in
run' /usr/lib/ruby/vendor_ruby/chef/application.rb:140:in
run_chef_client'/usr/lib/ruby/vendor_ruby/chef/application/solo.rb:224:in
run_application' /usr/lib/ruby/vendor_ruby/chef/application/solo.rb:216:in
loop'/usr/lib/ruby/vendor_ruby/chef/application/solo.rb:216:in
run_application' /usr/lib/ruby/vendor_ruby/chef/application.rb:72:in
run'/usr/bin/chef-solo:24
Relevant File Content:
/tmp/chef-solo/site-cookbooks/postgresql/definitions/pg_user.rb:
1>> define :pg_user, action: :create do
2: case params[:action]
3: when :create
4: privileges = {
5: superuser: false,
6: createdb: false,
7: login: true
8: }
9: privileges.merge! params[:privileges] if params[:privileges]
10:
The text was updated successfully, but these errors were encountered: