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

frozen String error on line 108 of link_renderer.rb #658

Closed
jdashton opened this issue May 22, 2024 · 1 comment
Closed

frozen String error on line 108 of link_renderer.rb #658

jdashton opened this issue May 22, 2024 · 1 comment

Comments

@jdashton
Copy link

When running tests on my project with RUBYOPT=--enable=frozen_string_literal -W:deprecated, I see this error:

     ActionView::Template::Error:
       can't modify frozen String: ""

This traces back to line 108 in link_renderer.rb, which is attempting to << into an empty string created on line 106.

If you alter line 106 to either of the following options, this problem should go away:

        string_attributes = attributes.inject(''.dup) do |attrs, pair|

or

        string_attributes = attributes.inject(+'') do |attrs, pair|

The latter option may be incompatible with early versions of Ruby.

@mislav
Copy link
Owner

mislav commented Jun 10, 2024

Thank you for reporting!

Fixed in #651

@mislav mislav closed this as completed Jun 10, 2024
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

No branches or pull requests

2 participants