[英]Windows: Elixir phoenix MIX_ENV=prod : The term is not recognized
Just started to learn elixir and phoenix framework. 刚开始学习elixir和phoenix框架。 for the most part it going well. 在大多数情况下,它进展顺利。 However when I want to run ecto.create on my production configs, I get an error in my cmd & powershell that MIX_ENV=prod : The term is not recognized. 但是当我想在我的生产配置上运行ecto.create时,我的cmd和powershell中出现错误MIX_ENV = prod:该术语无法识别。 Just in general though MIX_ENV=Xyz doesn't work for me. 总的来说虽然MIX_ENV = Xyz对我不起作用。
I've made a fresh new phoenix project to see if it was a compile problem. 我做了一个全新的凤凰项目,看看它是否是编译问题。 wasn't that. 不是那样的。
Working on windows. 在窗户上工作。
MIX_ENV=prod : The term 'MIX_ENV=prod' is not recognized as the name of a cmdlet, function, script file, or operable program. MIX_ENV = prod:术语“MIX_ENV = prod”未被识别为cmdlet,函数,脚本文件或可操作程序的名称。 Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。 At line:1 char:1 + MIX_ENV=prod mix phoenix.server + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (MIX_ENV=prod:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException 在行:1 char:1 + MIX_ENV = prod mix phoenix.server + ~~~~~~~~~~~~ + CategoryInfo:ObjectNotFound:(MIX_ENV = prod:String)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException
Any thoughts what would make a important function stop working? 什么会使一个重要的功能停止工作的任何想法?
phoenix,1.1.4 凤凰,1.1.4
Elixir 1.2.1 Elixir 1.2.1
Erlang/OTP 18 [erts-7.2.1] [64-bit] [smp:4:4] [async-threads:10] Erlang / OTP 18 [erts-7.2.1] [64位] [smp:4:4] [async-threads:10]
MIX_ENV
is an environment variable and you just need to set it. MIX_ENV
是一个环境变量,您只需要设置它。 Powershell does that differently than a *nix shell, so the examples that show putting MIX_ENV=prod
in line with the mix command won't work. Powershell与* nix shell的MIX_ENV=prod
不同,因此显示将MIX_ENV=prod
与mix命令一致的示例将不起作用。
Use $env:MIX_ENV="prod"
to set the environment variable and then call the rest of the mix command line. 使用$env:MIX_ENV="prod"
设置环境变量,然后调用mix命令行的其余部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.