phoenix_slime icon indicating copy to clipboard operation
phoenix_slime copied to clipboard

Error when trying to generate new layout

Open kevinl05 opened this issue 8 years ago • 5 comments

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

kevinl05 avatar Aug 13 '17 18:08 kevinl05

Howdy @Spinsus, have you tried master yet?

doomspork avatar Aug 14 '17 14:08 doomspork

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)?

ivanxuu avatar Oct 11 '17 08:10 ivanxuu

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

Gawyn avatar Feb 22 '18 02:02 Gawyn

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

neneboe avatar Mar 10 '18 16:03 neneboe

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

ramaboo avatar Apr 02 '18 07:04 ramaboo