我似乎得到了一个奇怪的编译错误,我不明白。我已经查看了其他示例,但我发现代码没有任何问题,但它不会编译。
这是红宝石代码:
glassfish_jdbc_connection_pool 'WebarcConnectionPool' do
domain_name 'staging'
password_file password_file
secure false
datasourceclassname 'com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource'
restype 'javax.sql.ConnectionPoolDataSource'
isconnectvalidatereq true
validationmethod 'table'
validationtable 'DATABASECHANGELOG'
ping true
description 'Webarc Connection Pool'
properties {
"user" => "user"
}
echo true
end
这是错误:
c:\devenv\src\chef-repo>knife cookbook upload glassfish
Uploading glassfish [0.5.28]
FATAL: Cookbook file recipes/create_domain.rb has a ruby syntax error:
FATAL: c:/devenv/src/chef-repo/.chef/../cookbooks/glassfish/recipes/create_domai
n.rb:64: syntax error, unexpected tASSOC, expecting '}'
FATAL: "user" => "user"
FATAL:
^
欢迎任何想法!
答案 0 :(得分:0)
您需要将其放在一行或使用括号
properties {"user" => "user"}
或者
properties({
"user" => "user"
})
或者
properties(
"user" => "user"
)