Đang cố gắng để xây dựng một API sử dụng Phoenix v1.3 làm theo hướng dẫn này:
https://dreamconception.com/tech/phoenix-full-fledged-api-in-five-minutes
(làm chắc chắn làm theo từng bước để thư)Phoenix 1.3 (Elixir) Lỗi: Myapp.Users.User .__ struct __/0 là undefined, không thể mở rộng struct Myapp.Users.User
Khi tôi cố gắng để chạy mix ecto.setup
tôi nhận được lỗi sau:
Compiling 17 files (.ex)
== Compilation error on file lib/myapp/users/users.ex ==
** (CompileError) lib/myapp/users/users.ex:65: Myapp.Users.User.__struct__/0 is undefined, cannot expand struct Myapp.Users.User
(stdlib) lists.erl:1354: :lists.mapfoldl/3
lib/myapp/users/users.ex:65: (module)
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
(elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
Các lib/myapp/users/users.ex
là khá lớn: https://github.com/nelsonic/phoenix-api-example/blob/master/lib/myapp/users/users.ex#L65
mã hoàn chỉnh trên GitHub: https://github.com/nelsonic/phoenix-api-example
Bất kỳ trợ giúp gỡ rối nó sẽ là nhiều đánh giá cao.
Bạn dường như không có mô-đun 'MyApp.Users.User'. –
Các tệp đó có phải nằm trong 'web /' trong 'lib /' trong Phoenix 1.3 không? Tôi có thể thấy 'defmodule Myapp.Users.User' trong' web/models/coherence/user.ex'. – Dogbert
@ Dogbert cũng phát hiện ra, tôi nghĩ rằng 'Coherence' là _assuming_ nó là một ứng dụng V1.2 ... – nelsonic