简体   繁体   English

Rails 5.2活动存储无法自动加载常量ActiveStorage :: Blob :: Analyzable

[英]Rails 5.2 Active storage Unable to autoload constant ActiveStorage::Blob::Analyzable

I've updated rails from 5.1.4 to 5.2 and remove Papaerclip to use Active Storage. 我已经将rails从5.1.4更新到5.2并删除了Papaerclip以使用Active Storage。 I'm using digitalocean spaces. 我正在使用digitalocean空间。 In my development env I've setted credentials in storage.yml to save images to digitalocean. 在我的开发环境中,我在storage.yml中设置了凭据,以将图像保存到digitalocean。

I've added aws gem in gemfile. 我在gemfile中添加了aws gem。 I run db:migrate for active storage. 我运行db:migrate进行活动存储。

But when I'm going to submit the form with an image upload html tag, i receive this error: Unable to autoload constant ActiveStorage::Blob::Analyzable. 但是当我要提交带有图片上传html标签的表单时,我收到此错误:无法自动加载常量ActiveStorage :: Blob :: Analyzable。

Anyone can help me? 有人可以帮帮我吗?

I had the same problem and I fixe it creating new project from scratch and error disapears. 我有同样的问题,我修复它从头开始创建新项目和错误消失。 I know that maybe you can't do this and I've look for possible diferences between project with the error and the new one. 我知道也许你不能这样做,我一直在寻找项目与错误和新错误之间的差异。

The only diference I could find is about Rails credentials. 我能找到的唯一区别是关于Rails凭据。 With new projects using Rails 5.2, Rails is creating credentials automatically. 使用Rails 5.2的新项目,Rails会自动创建凭据。 You could check if you have credentials enabled because you will see credentials.yml.enc and master.key in you config folder. 您可以检查是否已启用凭据,因为您将在配置文件夹中看到credentials.yml.enc和master.key。

If you don't have it, try to enable it using this tutorial https://medium.com/cedarcode/rails-5-2-credentials-9b3324851336 如果您没有,请尝试使用本教程启用它https://medium.com/cedarcode/rails-5-2-credentials-9b3324851336

Hope it helps! 希望能帮助到你!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails活动存储无法自动加载常量ActiveStorage :: Blob :: Analyzable - Rails Active storage Unable to autoload constant ActiveStorage::Blob::Analyzable 无法使用 Rails 5.2、AWS S3 和 ActiveStorage 自动加载常量 ActiveStorage::Blob::Analyzable 错误 - Unable to autoload constant ActiveStorage::Blob::Analyzable Error with Rails 5.2, AWS S3, and ActiveStorage 无法自动加载常量 ActiveStorage::Blob::Analyzable - Unable to autoload constant ActiveStorage::Blob::Analyzable Active Storage Rails的Blob错误5.2 - Blob Error with Active Storage Rails 5.2 Rails Active Storage Local attachemnt 因神秘错误而失败:未初始化的常量 Analyzable - Rails Active Storage Local attachemnt failing with cryptic errror: uninitialized constant Analyzable Rails 6 Active storage setup - NameError Exception: uninitialized constant #<class:0x00007fddde3597d8> ::可分析</class:0x00007fddde3597d8> - Rails 6 Active storage setup - NameError Exception: uninitialized constant #<Class:0x00007fddde3597d8>::Analyzable Rails无法自动加载常量 - Rails Unable to Autoload Constant Rails 在尝试使用 activeadmin 和 active storage 时找不到 ActiveStorage::Blob 关联的有效模型 - Rails couldn't find a valid model for ActiveStorage::Blob association, while trying to use activeadmin and active storage LoadError:无法在 Rails 中自动加载常量 - LoadError: Unable to autoload constant in Rails 测试时出现Rails Active_storage ActiveStorage :: IntegrityError - Rails Active_storage ActiveStorage::IntegrityError on test
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM