0

我似乎遇到了一个奇怪的编译错误,我只是不明白。我查看了其他示例,我的代码没有发现任何问题,但无法编译。

这是红宝石代码:

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:   

       ^

欢迎任何想法!

4

1 回答 1

0

您需要将其放在一行或使用括号

properties {"user" => "user"}

或者

properties({
  "user" => "user"
})

或者

properties(
  "user" => "user"
)
于 2014-04-29T20:54:34.263 回答