Phoenixウェブサイトのガイドを踏まえて作業しています.Ectoのモデル - http://www.phoenixframework.org/docs/ecto-modelsのページまでありますが、どうしたらよいかわかりませんアドレス...Phoenix - モデルの移行を生成するときにコンパイルエラーが発生する
私はmix phoenix.gen.html User users name:string email:string bio:string number_of_pets:integer * creating priv/repo/migrations/20150409213440_create_user.exs
を実行すると、すべてのファイルが正しく作成されています
* creating web/controllers/user_controller.ex
* creating web/templates/user/edit.html.eex
* creating web/templates/user/form.html.eex
* creating web/templates/user/index.html.eex
* creating web/templates/user/new.html.eex
* creating web/templates/user/show.html.eex
* creating web/views/user_view.ex
* creating test/controllers/user_controller_test.exs
* creating web/models/user.ex
* creating test/models/user_test.exs
* creating priv/repo/migrations/20161128174142_create_user.exs
が、私のサーバーコンソールには、すぐにエラーを吐くバック:
Compiling 3 files (.ex)
== Compilation error on file web/views/user_view.ex ==
** (CompileError) web/views/user_view.ex:2: module TestApp_1.Web is not loaded and could not be found
(elixir) expanding macro: Kernel.use/2
web/views/user_view.ex:2: TestApp_1.UserView (module)
(elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
mix ecto.migrate
が失敗し、このエラーも同様に返されます(ユーザーリソースをルートに追加しても)。
これは実際にこのプロセスを経る2回目です。最初に実行したときはすべて正常でした。私が知る限り、今回はまったく同じことをしました(間違いかもしれませんが)。
このエラーを解釈するためにPhoenixに十分な経験がないか、問題の解決方法を知っています。誰も助けることができますか?
* UPDATE * それはその問題は私のアプリモジュールはTestApp1
と命名されたという事実から来判明したが、アンダースコアが...末尾の数字と名前に挿入されているフェニックスのバグがあるので、それを見ていましたTestApp_1
です。私は、生成されたファイルを調べてアンダースコアを削除するだけで、これを修正することができました。バグの詳細な説明については、以下のDogbertのコメントを参照してください。
あなたはどのバージョンのPhoenixをお使いですか?あなたのアプリケーションのモジュールの名前は何ですか? (lib/your_app_name.exの最初の行) – Dogbert
@DogbertバージョンはPhoenix v1.2.1です。アプリケーションモジュールの名前はTestApp1です。ええと、それはTestApp_1を探しているようです。おそらくそれは問題ですか?もしそうなら、その下線がどのようにそこに入りましたか? – skwidbreth
フェニックスのバグだった:https://github.com/phoenixframework/phoenix/pull/1855。 – Dogbert