rails active_storage:install IS NOT WORKING

后端 未结 4 2068
无人及你
无人及你 2021-01-05 00:34

I have updated my rails api application from 5.1 to 5.2. I am using rails api only. I am trying to use the active storage. I think the problem is due to the line conf

相关标签:
4条回答
  • 2021-01-05 00:37

    Your problem is here:

    require "active_storage"
    

    You need to require the engine:

    require "active_storage/engine"
    
    0 讨论(0)
  • 2021-01-05 00:38

    The current rails official documents talks about the new application. But if you're upgrading a pre 5.2 app, you have to add or uncomment the field in application.rb

    require "active_storage/engine"
    

    For the new application, this will be already added.

    0 讨论(0)
  • 2021-01-05 00:46

    Try running command in the project root

    bin/rails activestorage:install
    

    or

    rake active_storage:install

    0 讨论(0)
  • 2021-01-05 00:55

    Having this in the config

    require "active_storage/engine"
    

    and running this

    bundle exec rails active_storage:install
    

    This worked for me. I updated from rails 5.1 to 6.0.2.1

    0 讨论(0)
提交回复
热议问题