Without parentheses, ruby is interpreting it as
phrase.last.eql?( "?" ? true : false )
which explains the message "warning: string literal in condition".
To fix this, use parentheses on the parameter:
phrase.last.eql?("?") ? true : false
Of course, in this case using the ternary operator is redundant since this is the same as simply
phrase.last.eql?("?")