2016-11-28 9 views
1

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のコメントを参照してください。

+0

あなたはどのバージョンのPhoenixをお使いですか?あなたのアプリケーションのモジュールの名前は何ですか? (lib/your_app_name.exの最初の行) – Dogbert

+0

@DogbertバージョンはPhoenix v1.2.1です。アプリケーションモジュールの名前はTestApp1です。ええと、それはTestApp_1を探しているようです。おそらくそれは問題ですか?もしそうなら、その下線がどのようにそこに入りましたか? – skwidbreth

+1

フェニックスのバグだった:https://github.com/phoenixframework/phoenix/pull/1855。 – Dogbert

答えて

0

私のアプリケーションモジュールにはTestApp1という名前が付けられていますが、Phoenixにはファイルが生成されたときに末尾に名前にアンダースコアが挿入されているというバグがあります... TestApp_1 。私は、生成されたファイルを調べてアンダースコアを削除するだけで、これを修正することができました。バグの詳細な説明については、Dogbertのコメントを参照してください。

関連する問題