ruby-on-rails - Rails activestorage 不会创建迁移文件
问题描述
我使用 Rails 中内置的 activestorage gem 为用户配置文件上传图像,但它不起作用,有趣的是没有错误,只是没有创建迁移。
这里有什么问题,关于如何解决这个问题的任何想法?
导轨版本 - 6.0
我已经添加require 'active_storage/engine'
到config/application.rb
文件中然后运行rails active_storage:install
更有趣的是,我在没有添加require active_storage/engine
到 application.rb 的情况下得到了相同的输出。并且没有错误
输出
** Invoke active_storage:install (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute active_storage:install
** Invoke active_storage:install:migrations (first_time)
** Execute active_storage:install:migrations
** Invoke railties:install:migrations (first_time)
** Invoke db:load_config (first_time)
** Invoke environment
** Execute db:load_config
** Execute railties:install:migrations```
I expect the migration file to be created after this but it is not.
解决方案
推荐阅读
- overlap - Phaser 3 穿刺子弹多次击中
- c# - 如何在WPF中将矩形内的图像区域作为单独的图像获取?
- angular - 如何在角度路由之间传递和访问数据?
- c# - 从派生类实例访问受保护的构造函数
- passwords - 如何使用 crunch 在 charset.lst 中附加两组选项
- css - 如何在wordpress中编辑Carena主题标题中按钮的悬停颜色?
- android - Android Retrofit - 如何解析 Github Emojis API
- ruby - 使用 rspec 和 Capybara 进行测试时,Mongoid 验证错误“电子邮件不能为空”,但字段不为空
- amazon-web-services - AWS Managed AD (Enterprise) 中的 DNS 转发不起作用,是否支持?
- r - R101 与 mutate()