ruby-on-rails - 初始页面加载时的 ActiveStorage::FileNotFoundError(有时)
问题描述
在我的 Rails 应用程序中,我遇到了一个关于主动存储的奇怪问题,错误显示:
ActiveStorage::FileNotFoundError ActiveStorage::Representations::RedirectController#show
并且这个 LoadError 被击中
raise LoadError, "Unable to autoload constant #{qualified_name}, expected #{file_path} to define it"
具体错误:
Unable to autoload constant ActiveStorage::Blobs::RedirectController, expected /Users/username/.rvm/gems/ruby-2.6.6/gems/activestorage-6.1.3/app/controllers/active_storage/blobs/redirect_controller.rb to define it
这种情况仅在某些时候发生,如果发生,页面刷新将使图像显示。发生这种情况时,图像不会加载并且似乎已损坏。我不能始终如一地重现这个,有什么想法吗?
红宝石 2.6.6p146 轨道 6.1.3
解决方案
推荐阅读
- jdbc - IIB 没有找到 jdbc 驱动程序
- python - 如何从继承类的方法扩展列表
- apache-spark - 如何从 pyspark 的结构字段中删除 NULL?
- jquery - 捕获事件并防止触发后代码执行
- node.js - 在浏览器中查看而非下载 Google Cloud Storage 文件
- python - 按位置获取大量推文
- json - 从 Oracle 存储过程生成 JSON
- ruby-on-rails - Rails 与自身的关联不起作用
- qt - 如何使用 QMessageBox 显示纯文本?
- python - 遍历进程列表以检查 PID 是否与 Python 子进程一起存在