[英]Rails: Frozen Error when trying to run rails application
I am running a rails application and when it now shows the below error in console and web application is not loading.我正在运行一个 rails 应用程序,当它现在在控制台中显示以下错误并且 Web 应用程序未加载时。
FrozenError (can't modify frozen fatal): FrozenError(不能修改冻结致命):
Please help as I don't even understand what this is.请帮忙,因为我什至不明白这是什么。 Will provide any further code details if mentioned.如果提到,将提供任何进一步的代码详细信息。
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.我看到了 FrozenError 类文档,发现这是在 ruby 2.5.x 及更高版本中引入的。 This is the document FrozenError Doc .这是文档FrozenError Doc 。 I just first upgraded ruby version to latest 2.6.x but this didn't solve the issue.我只是首先将 ruby 版本升级到最新的 2.6.x 但这并没有解决问题。
Fix:使固定:
I got the same error when upgrading a Rails app from 4.2.10 to 5.0.将 Rails 应用程序从 4.2.10 升级到 5.0 时,我遇到了同样的错误。 The error only happened with wicked_pdf 2.0.1, a downgrade to wicked_pdf 1.4.0 also made the trick.该错误仅发生在 wicked_pdf 2.0.1 中,降级到 wicked_pdf 1.4.0 也成功了。
For me, it occurred when I tried to find resource.class
after running build_resource
,对我来说,它发生在我在运行build_resource
后试图找到resource.class
,
To solve this I removed .class from the resource
object为了解决这个问题,我从resource
对象中删除了 .class
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.