slime-lang / phoenix_slime

Phoenix Template Engine for Slime
MIT License
310 stars 66 forks source link

Error when trying to generate new layout #54

Open kevinl05 opened 7 years ago

kevinl05 commented 7 years ago

Freshly created Phoenix project, when trying to run mix phoenix.gen.layout.slime I'm receiving this error

** (UndefinedFunctionError) function Mix.Phoenix.copy_from/5 is undefined or private. Did you mean one of:

  * copy_from/4

Mix.Phoenix.copy_from([".", :phoenix_slime], "priv/templates/phoenix.gen.layout.slime", "", [application_module: "ApplicationName"], [{:eex, "app.html.eex", "web/templates/layout/app.html.slim"}])
lib/mix/tasks/phoenix.gen.layout.slime.ex:16: Mix.Tasks.Phoenix.Gen.Layout.Slime.run/1
(mix) lib/mix/task.ex:301: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:75: Mix.CLI.run_task/2
(elixir) lib/code.ex:376: Code.require_file/2
doomspork commented 7 years ago

Howdy @Spinsus, have you tried master yet?

ivanxuu commented 7 years ago

For me using master like this in mix.exs works fine:

 defp devs do
   ...
   {:phoenix_slime, github: "slime-lang/phoenix_slime"}
   ...
 end

Maybe would be worth it to bumb the version available at hex.pm (0.9.0)?

Gawyn commented 6 years ago

I am having the same issue, and running the slime version in Github solves it.

neneboe commented 6 years ago

Also, the command generates the file in the wrong directory for the phoenix 1.3 default directory structure. Currently generates in web/templates/layout, should generate in lib/[app name]_web/templates/layout

ramaboo commented 6 years ago

slime 0.6.0 new phoenix 132 app fails with

➜  skippy git:(master) ✗ mix phoenix.gen.layout.slime
** (UndefinedFunctionError) function Mix.Phoenix.copy_from/5 is undefined or private. Did you mean one of:

      * copy_from/4

    Mix.Phoenix.copy_from([".", :phoenix_slime], "priv/templates/phoenix.gen.layout.slime", "", [application_module: "ApplicationName"], [{:eex, "app.html.eex", "web/templates/layout/app.html.slim"}])
    lib/mix/tasks/phoenix.gen.layout.slime.ex:16: Mix.Tasks.Phoenix.Gen.Layout.Slime.run/1
    (mix) lib/mix/task.ex:314: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:80: Mix.CLI.run_task/2
    (elixir) lib/code.ex:677: Code.require_file/2