我在厨师模板中有以下代码,但在上传到厨师服务器时出错。我该如何解决?
<%
contents_hash = File.read('/tmp/cluster_hash')
neoservers_hash = JSON.parse(contents_hash)
-%>
<% "#{neoservers_hash}".each_pair do |id, ipaddress| %>
<%= "server.#{id}=#{ipaddress}:2888:3888" %>
<% end %>
当我尝试上传食谱时,我收到以下错误:
$ knife cookbook upload neo4j -E development
Uploading neo4j [0.1.0]
FATAL: Erb template templates/default/coord.cfg.erb has a syntax error:
FATAL: -:7: syntax error, unexpected tIDENTIFIER, expecting '}'
FATAL: _buf << ( "server.#{id}=#{ipaddress}:2888:3888" ).to_s; _buf << '
FATAL: ^
FATAL: -:8: unterminated string meets end of file