Closed siraisi368 closed 1 month ago
@siraisi368 以下のコマンドは実行していますでしょうか。
docker compose run --rm web bin/rake db:seed
はい。実行済みです。
Administrator account created.
と表示されたのを確認しています。
@siraisi368 以下を実行して、最後の行にメールアドレスのような文字列が表示されますでしょうか。
docker compose run --rm web bin/rails r 'puts LibraryGroup.find(1).user.email'
もしエラーになる場合、なんらかの理由で初期データの投入がうまくいっていない可能性があります。
undefined method `email' for nil:NilClass
と出力されるので
うまく行ってなさそうです。
初期設定時のログインユーザについてですが、rootで行うと不具合が出やすい等ありますか?
@siraisi368 初期ユーザの作成はbin/rake db:seed
の以下の行で、コンテナ内で実行されるので、関係はないはずです。
https://github.com/next-l/enju_leaf/blob/v1.4.8/db/seeds.rb#L31
ただ、初期データが足りないのなら、この行でコマンドが失敗するはずなのですよね…。新規インストールであれば、データベースのボリュームを一度削除し、もう一度データベースの作成を行ってみていただけますか。
docker compose down
docker volume rm enju_leaf_postgres # ボリュームの削除
docker compose up -d
docker compose run --rm web bin/rake db:create
docker compose run --rm web bin/rake db:migrate
docker compose run --rm web bin/rake db:seed
ボリューム削除ののち、もう一度データベースの作成をやり直したらうまく表示されるようになりました。 ありがとうございます
@siraisi368 よかったです。Solrの再インデックスも行っておいてください。
docker compose run --rm web bin/rake sunspot:reindex
わかりました、ありがとうございます
手順通り正しくインストールを行ったが ログインし設定画面に入ろうとしても このようになり入ることができない。
ログには
と残されていた。
環境: Docker 27.1.2, build d01f264 Miracle Linux 9 (RHEL9クローン) Enju_leaf Version 1.4