The error indicates that ternary operator has lower priority than method argument. Ruby parses around the first instance of puts
method up to:
puts "true"
and looks if there is another argument, which should be preceded by a comma if there is any. But you have a colon continuing:
: puts "false"
which cases a syntax error.