在 Rails 5.2 中禁用 Active Storage [英] Disable Active Storage in Rails 5.2
本文介绍了在 Rails 5.2 中禁用 Active Storage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将 Rails 升级到 5.2,我发现我必须将 storage.yml 提交到版本控制中.我不打算使用 ActiveStorage.有没有办法禁用它?
Upgrading Rails to 5.2, and I found out that I must commit the storage.yml into version control. I don't plan to use ActiveStorage. Is there a way to disable it?
推荐答案
从 config/application.rb
require "active_storage/engine"
从环境中删除下一行 config/environments/*.rb
config.active_storage.service = :local
从 app/assets/javascripts/application.js
//= require activestorage
ActiveStorage rails 路由将消失
ActiveStorage rails routes will vanish
如果 application.rb
中有声明 require 'rails/all'
那么你可以使用下面提供的解决方案,你需要依赖依赖并省略active_storage
.
In case there is statement require 'rails/all'
in application.rb
then you can use solution provided below where you need to require dependency by dependency and to omit active_storage
.
这篇关于在 Rails 5.2 中禁用 Active Storage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文