Reputation: 521
I am running a rails application and when it now shows the below error in console and web application is not loading.
FrozenError (can't modify frozen fatal):
Please help as I don't even understand what this is. Will provide any further code details if mentioned.
Upvotes: 5
Views: 2114
Reputation: 3
If anyone still struggling with that error, perhaps could be the name of you file
Example:
# filename my_api_class.rb -> bad should be my_a_p_i_class.rb
class MyAPIClass
to
# filename my_api_class.rb
class MyApiClass
Upvotes: 0
Reputation: 477
For me, it occurred when I tried to find resource.class
after running build_resource
,
To solve this I removed .class from the resource
object
Upvotes: 1
Reputation: 51
I got the same error when upgrading a Rails app from 4.2.10 to 5.0. The error only happened with wicked_pdf 2.0.1, a downgrade to wicked_pdf 1.4.0 also made the trick.
Upvotes: 5
Reputation: 521
Finally, I found the reason. I will explain here the way which I found the solution for the issue so that it may help others who encounter the same error.
I saw the FrozenError class documentation and found that this was introduced in ruby 2.5.x and later. This is the document FrozenError Doc . I just first upgraded ruby version to latest 2.6.x but this didn't solve the issue.
Fix:
Upvotes: 3