バグ:SiteCategorySerializer の未初期定数

投票プラグインを使って Discourse を再ビルドしようとした際に、以下のエラーが表示されます。

NameError: uninitialized constant SiteCategorySerializer
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:283:in `const_get'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:283:in `block in constantize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:281:in `inject'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:281:in `constantize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/core_ext/string/inflections.rb:68:in `constantize'
/var/www/discourse/lib/plugin/instance.rb:93:in `block in add_to_serializer'
/var/www/discourse/lib/plugin/instance.rb:699:in `reloadable_patch'
/var/www/discourse/lib/plugin/instance.rb:92:in `add_to_serializer'
/var/www/discourse/plugins/discourse-voting/plugin.rb:82:in `block (2 levels) in activate!'
/var/www/discourse/plugins/discourse-voting/plugin.rb:81:in `each'
/var/www/discourse/plugins/discourse-voting/plugin.rb:81:in `block in activate!'
/var/www/discourse/lib/plugin/instance.rb:328:in `block in notify_after_initialize'
/var/www/discourse/lib/plugin/instance.rb:326:in `each'
/var/www/discourse/lib/plugin/instance.rb:326:in `notify_after_initialize'
/var/www/discourse/config/application.rb:292:in `each'
/var/www/discourse/config/application.rb:292:in `block in <class:Application>'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'

これは、プラグイン内で最近行われたリファクタリングに関連しているようです。

私が試した中で、最後に問題なく動作したバージョンは以下のものです。

使用している Discourse のバージョンは 2.3.2 です。

「いいね!」 1

つまり、投票プラグインは 2.3(安定版)とはもはや互換性がないということですか?

「いいね!」 2

おそらく、いくつかの内部インターフェースを変更しましたが、互換性を確保できるはずです。

「いいね!」 2

今日、安定版をアップグレードしたら、これに遭遇しました。
誰かのためになるか、より良い方法をご存知の方がいればと思い、一時的な解決策を共有します。


hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/discourse-voting.git
          - cd discourse-voting && git reset --hard 9b4f233b9d33a946f626597aaf3863d2305b8809 && cd ..
「いいね!」 1

これは以下の通り修正されました:

および

コアの変更は安定版にもバックポートされました。

「いいね!」 6

このトピックは 47 時間後に自動的に閉鎖されました。新しい返信は受け付けておりません。