@ledsun blog

無味の味は佳境に入らざればすなわち知れず

rails runnerを使う代わりに実行コマンドでRailsの環境を読み込む

Load the Rails environment with the run command instead of using the … · ledsun/activerecord_uml@e58e990 · GitHub

↑の変更で、行けました。

使用イメージは以下の通りです。

~ activerecord_uml Computer
<html>
  <body>
    <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
    <script>mermaid.initialize({startOnLoad:true});</script>

    <div class="mermaid">

classDiagram
  class Computer {
   integer id
    string user_name
    string maker
    string memory
   integer release_year
  datetime created_at
  datetime updated_at
}


    </div>
  </body>
</html>

代わりに、実行場所がRailsプロジェクトのrootディレクトリに限られるようになりました。 今のところの自分の使い方では特に困らないので、様子を見てみます。

参考