How i can set frozen_string_literal in pry?

In ruby version 2.3.0 and higher, I can work with frozen string.

I can activate this mode with:

  1. magic comment: #frozen_string_literal_string: true

  2. or with the flag: --enable-frozen-string-literal

Working with irb, for example, I can set the variable $RUBYOPT:

RUBYOPT = - enable-frozen-string-literal irb

How can I work with frozen string in pry session?

I tried to put #frozen_string_literal in the .pryrc file but it does not work.

Hello @dp100,

Looks like this is an open issue: Enabling # frozen_string_literal: true in ~/.pryc crashes most operations #1824