ex_admin
ex_admin copied to clipboard
module MyApp.ExAdmin.Dashboard is not available
Hello!
I've just installed a ex_admin in my phoenix app using a getting started tutorial present on this repo's README and i can't access the /admin
route. Phoenix throws
function MyApp.ExAdmin.Dashboard.__struct__/0 is undefined (module MyApp.ExAdmin.Dashboard is not available)
My setup:
- phoenix
1.3.0
- ecto
2.1.6
- phoenix_ecto
3.2.3
- ex_admin
master
I suspect that it's related to the fact that i'm on ex_admin master
but i really can't use any other branch/tag in cause of their phoenix_ecto dependencies (master is the only one supporting 3.2). I'm not sure if i encountered a bug on master or i'm doing something wrong but - hopefully that's my fault :)
Thanks in advance!
Hi,
try with instructions on branch phx-1.3
Anyway, I needed to change line 18 in ex_admin/lib/tasks/util.ex
from:
path1 = Path.join ["lib", to_string(Mix.Phoenix.otp_app()), "web"]
to:
path1 = Path.join ["lib", to_string(Mix.Phoenix.otp_app()) <> "_web"]
I tried with the instruction on branch phx-1.3 and I still get the same error, even after making the change you recommended
Did you run mix deps.compile
after making the change described above?
BTW after successful mix admin.install
you should add to your config/config.exs
file
config :ex_admin,
repo: MyProject.Repo,
module: MyProjectWeb, # NOT MyProject or MyProject.Web !
...
Thanks a lot! I hadn't run mix deps.compile
after making the changes, now it works
btw for anybody reading this. After that I was a little surprised that it was empty, you need to add the ressources one by one after that with the command Union.ExAdmin.Context.Ressource
it's detailed in the get_started part here https://github.com/smpallen99/ex_admin/tree/phx-1.3
@mbaleczny Cannot find ex_admin/lib/tasks/util.ex
This issue is now fixed fixed in PR #403
Following guide still doesn't work.
@StephanMeijer
The path ex_admin/lib/tasks/util.ex
it's wrong. My mistake. It should be ex_admin/lib/mix/utils.ex
, but this is not the issue anymore. You don't have to
I've followed the guide again on fresh project and it's working.
Make sure you use dependency {:ex_admin, github: "smpallen99/ex_admin", branch: "phx-1.3"}
. I also advise you to run mix do deps.clean -all, deps.get, deps.compile
.
I love you.