In pure Ruby irb, one cannot type {if: 1}. The statement will not terminate, because irb thinks if is not a symbol but instead the beginning of an
{if: 1}
if
That's an irb issue, not Ruby.
bash=> ruby -e "puts({if: 1})" bash=# {:if=>1}
You can use pry instead. It will read input correctly.
pry
https://github.com/pry/pry