我遇到了语法错误,不确定如何解决。在角色文件中,我定义了以下内容:
default_attributes(
'jdk' => {
'version' => '1.8.0_31'
},
'java' => {
'home' => '/usr/lib/jvm/jdk1.8.0_31'
},
)
我尝试使用以下的Java路径,但运行失败了。
execute "update_alt_java" do
command "update-alternatives --install "/usr/bin/java" "java" "#{node['java']['home']}/bin/java" 1"
action :creates
end
我收到了以下错误信息。
SyntaxError
-----------
/etc/chef/src/cookbooks/jdk/recipes/default.rb:50: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
...tives --install "/usr/bin/java" "java" "#{node['java']['home...
... ^
/etc/chef/src/cookbooks/jdk/recipes/default.rb:50: syntax error, unexpected tIDENTIFIER, expecting keyword_end
...--install "/usr/bin/java" "java" "#{node['java']['home']}/bi...