无法使用续集rails gem安装rails active_storage

时间:2018-07-04 05:43:19

标签: ruby-on-rails rubygems sequel ruby-on-rails-5.2

我正在尝试在rails 5.2上安装active_storage,并且我在使用sequel-rails gem而不是active record。 执行“ rails active_storage:install”时出现以下错误

  耙子中止了!不知道如何建立任务   'app:railties:install:migrations'(请参阅--tasks)   /home/edmodo/.rvm/gems/ruby-2.4.3/gems/railties-5.2.0/lib/rails/engine.rb:635:in   在“ block (4 levels) in <class:Engine>' /home/edmodo/.rvm/gems/ruby-2.4.3/gems/activestorage-5.2.0/lib/tasks/activestorage.rake:7:in   /home/edmodo/.rvm/gems/ruby-2.4.3/gems/rake-12.3.1/exe/rake:27:in   <top (required)>' /home/edmodo/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:24:in 评估'   /home/edmodo/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:24:in   `'任务:TOP => active_storage:install:migrations

有人可以帮助我解决此问题吗?

1 个答案:

答案 0 :(得分:0)

据我所知,您目前无法将Active Storage与Sequel一起使用,因为它对Active Record类有严格的依赖性。

https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/attachment.rb#L9

您需要为Active Store使用替代解决方案,例如Shrine,或者需要使用Active Record。