[英]missing Phoenix specific mix tasks / generators
I'm missing Phoenix specific mix tasks, eg mix phoenix.gen.html 我缺少Phoenix特定的混音任务,例如mix phoenix.gen.html
$ mix help | $ mix help | grep -i phoenix grep -i phoenix
mix local.phoenix # Updates Phoenix locally mix local.phoenix#更新凤凰本地
mix phoenix.new # Creates a new Phoenix v1.2.1 application mix phoenix.new#创建一个新的Phoenix v1.2.1应用程序
$ mix -v $ mix -v
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Erlang / OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Mix 1.3.4 混合1.3.4
$ elixir -v $ elixir -v
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Erlang / OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Elixir 1.3.4 Elixir 1.3.4
I've re-installed Erlang, Node, Elixir, Phoenix on my Mac (using brew) and nothing seems to resolve the issue. 我在我的Mac上重新安装了Erlang,Node,Elixir,Phoenix(使用brew),似乎没有解决问题。
Here is the output running it from the Phoenix app directory 以下是从Phoenix app目录运行它的输出
$ mix phoenix.new hello
$ cd hello
$ ls
README.md brunch-config.js deps mix.exs node_modules priv web _build config lib mix.lock package.json test
$ mix -h | fgrep phoenix
mix local.phoenix # Updates Phoenix locally
mix phoenix.new # Creates a new Phoenix v1.2.1 application
All tasks other than local.phoenix
and phoenix.new
, like phoenix.gen.html
are only available from inside a Phoenix app's diretory. 除了local.phoenix
和phoenix.new
之外的所有任务,例如phoenix.gen.html
,只能在Phoenix应用程序的指令中找到。 You should see them in mix help
if you run it from inside an app's directory. 如果从应用程序目录中运行它,您应该在mix help
看到它们。
Note: You'll have to compile the app once using mix compile
if you want to see it appear in mix help
in a brand new app that has never been compiled. 注意:如果你想在一个从未编译过的全新应用程序中看到它出现在mix help
中,你必须使用mix compile
一次应用程序。 If you directly to run one of those task though, it will succeed since mix
will compile the app before trying to run it. 如果你直接运行其中一个任务,它会成功,因为mix
会在尝试运行之前编译应用程序。
Outside any app's directory: 在任何应用程序的目录之外:
$ mix help | grep phoenix
mix local.phoenix # Updates Phoenix locally
mix phoenix.new # Creates a new Phoenix v1.2.1 application
Inside an app's directory (make sure the app is compiled by running mix compile
first): 在应用程序的目录中(确保通过首先运行mix compile
应用程序):
$ mix help | grep phoenix
mix local.phoenix # Updates Phoenix locally
mix phoenix.digest # Digests and compress static files
mix phoenix.gen.channel # Generates a Phoenix channel
mix phoenix.gen.html # Generates controller, model and views for an HTML based resource
mix phoenix.gen.json # Generates a controller and model for a JSON based resource
mix phoenix.gen.model # Generates an Ecto model
mix phoenix.gen.presence # Generates a Presence tracker
mix phoenix.gen.secret # Generates a secret
mix phoenix.new # Creates a new Phoenix v1.2.1 application
mix phoenix.routes # Prints all routes
mix phoenix.server # Starts applications and their servers
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.