Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FrozenError: can't modify frozen String: "" #80

Open
dhurba87 opened this issue Mar 17, 2021 · 1 comment · May be fixed by #81
Open

FrozenError: can't modify frozen String: "" #80

dhurba87 opened this issue Mar 17, 2021 · 1 comment · May be fixed by #81

Comments

@dhurba87
Copy link

I'm getting following exception from ruby 2.7.2

Please select the project for the current directory (1-1, 'q' to exit)
1

Thanks! I'm saving this project's info
in /Users/dhurba/code/random/pt/.pt: remember to .gitignore it!
[1/199]
bundler: failed to load command: ./bin/pt (./bin/pt)
FrozenError: can't modify frozen String: ""
  /Users/dhurba/code/random/pt/lib/pt/data_row.rb:22:in `force_encoding'
  /Users/dhurba/code/random/pt/lib/pt/data_row.rb:22:in `method_missing'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `block (2 levels) in render'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `each'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `inject'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `block in render'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `each'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `inject'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `render'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/helpers/auto_table.rb:22:in `render'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/formatter.rb:73:in `_format_output'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/formatter.rb:56:in `format_output'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/view.rb:205:in `render_output'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/console.rb:18:in `render_output'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/hirb-0.7.3/lib/hirb/console.rb:30:in `table'
  /Users/dhurba/code/random/pt/lib/pt/data_table.rb:27:in `print'
  /Users/dhurba/code/random/pt/lib/pt/helper.rb:233:in `select'
  /Users/dhurba/code/random/pt/lib/pt/helper.rb:256:in `select_story_from_paginated_table'
  /Users/dhurba/code/random/pt/lib/pt/cli.rb:52:in `block (2 levels) in <class:CLI>'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
  /Users/dhurba/.rvm/gems/ruby-2.7.2/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
  /Users/dhurba/code/random/pt/bin/pt:10:in `<top (required)>'

@dhurba87
Copy link
Author

It looks like our code is trying to change frozen string generated from nil.to_s. Starting from ruby 2.7 nil.to_s is a frozen string. The returned String is always the same for a given object. Feature

@dhurba87 dhurba87 linked a pull request Mar 17, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant