age = 27
word = "age = #{age}"
if age > 20 ? puts(word) : "no , no"
代码如上,我想做的事情,很明显,一个简单的条件判断执行。
但是运行出现错误,
./start.rb:171: syntax error, unexpected end-of-input, expecting keyword_then or ';' or 'n'
0 ? puts(word) : "Oh ,no , no"
怎么解决?加一点说明解释,更好啦,
if then end
这几个都要有,只写if是语法错误