clear-code / redmine_full_text_search

Full text search for Redmine
MIT License
61 stars 24 forks source link

Mroonga's method is called when using PostgreSQL #66

Closed ryouma-nagare closed 5 years ago

ryouma-nagare commented 5 years ago

環境情報

Pgroongaの導入後、redmineの再起動時に以下のログが unicorn.stderr.log に出力されて起動できません。

bundler: failed to load command: unicorn_rails (/opt/redmine/vendor/bundle/ruby/2.5.0/bin/unicorn_rails)
NoMethodError: undefined method `mroonga_vector_load_is_supported?' for #<Class:0x0000000008329878>
  /opt/redmine/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.3/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
  /opt/redmine/plugins/full_text_search/app/types/full_text_search/mroonga_integer_array_type.rb:29:in `<class:MroongaIntegerArrayType>'
  /opt/redmine/plugins/full_text_search/app/types/full_text_search/mroonga_integer_array_type.rb:3:in `<module:FullTextSearch>'
  /opt/redmine/plugins/full_text_search/app/types/full_text_search/mroonga_integer_array_type.rb:1:in `<top (required)>'

プラグインのインストール/アンインストールを何度か繰り返したのですが解決せず、ふと思いついて plugins/full_text_search/app/types/full_text_search/mroonga_integer_array_type.rb をリネームしたところ起動し、検索結果も表示されるようになりました。

何かこちらの環境に問題があるのでしょうか。

kou commented 5 years ago

うーん、だれが読んでいるのかしら。 productionモードだと起動時に全部のファイルをrequireするんだったかしら。

PGroongaを使っているときは実行時にMroonga用のメソッドを呼び出さないようにしてみたつもりです。

ryouma-nagare commented 5 years ago

無事に起動するようになりました。 ありがとうございます!

kou commented 5 years ago

よかったです! 今のPGroongaにバグがあって(masterでは修正済みなので次のリリースで直る)、もしかしたら検索結果のレコードの日時が1970-01-01になっちゃうものがあるかもしれませんが、表示だけの問題なので気にしないでください!