简体   繁体   English

混合ecto.create时argon2 lix剂编译问题

[英]argon2 elixir compilation issue while mix ecto.create

I am getting the below error while running mix ecto.create to create the postgres DB. 运行mix ecto.create创建postgres DB时出现以下错误。

==> argon2_elixir
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
==> snitch_core
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.

I am defining it in the mix.exs file under apps folder as below: 我在apps文件夹下的mix.exs文件中定义它,如下所示:

  # auth
  {:elixir_make, "~> 0.4.2"},
  {:comeonin, "~> 4.1.1"},
  {:argon2_elixir, "~> 1.3.3"},

Tried to recompile the package as suggested in the error message but nothing helped. 试图按照错误消息中的建议重新编译软件包,但没有任何帮助。

Appreciate help in this regard. 在这方面提供帮助。

It appears that you don't have nmake installed. 看来您没有安装nmake You're on Windows I presume? 我猜您在Windows上吗? Install nmake one way or another, see for example this answer . 一种或另一种方式安装nmake ,例如参见此答案

I was able to solve it finally. 我终于能够解决它。 Here is the general approach to attack the problem and solve it, irrespective of your specific issues. 不管您遇到什么具体问题,这都是解决问题和解决问题的通用方法。

First, I copied the nmake.exe from the visual studio folder C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\Hostx64\\x64\\ and pasted in System32 folder. 首先,我复制了nmake.exe从Visual Studio文件夹C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\Hostx64\\x64\\ ,并在System32中粘贴夹。 Ran the command mix ecto.create and received a changed elaborate error which solved the issue. 运行命令mix ecto.create并收到更改后的详细错误,此问题已解决。 Here is the output of the error: ** (Mix) Could not compile with "nmake" (exit status: 2). One option is to install a recent version of [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) either manually or using [Chocolatey](https://chocolatey.org/) - 以下是错误的输出: ** (Mix) Could not compile with "nmake" (exit status: 2). One option is to install a recent version of [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) either manually or using [Chocolatey](https://chocolatey.org/) - ** (Mix) Could not compile with "nmake" (exit status: 2). One option is to install a recent version of [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) either manually or using [Chocolatey](https://chocolatey.org/) - choco install VisualCppBuildTools`. ** (Mix) Could not compile with "nmake" (exit status: 2). One option is to install a recent version of [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) either manually or using [Chocolatey](https://chocolatey.org/) - -choco安装VisualCppBuildTools`。

After installing Visual C++ Build Tools, look in the "Program Files (x86)" directory and search for "Microsoft Visual Studio". 安装Visual C ++生成工具后,在“程序文件(x86)”目录中查找并搜索“ Microsoft Visual Studio”。 Note down the full path of the folder with the highest version number. 记下具有最高版本号的文件夹的完整路径。 Open the "run" command and type in the following command (make sure that the path and version number are correct): 打开“运行”命令并键入以下命令(确保路径和版本号正确):

cmd /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

This should open up a command prompt with the necessary environment variables set, and from which you will be able to run the "mix compile", "mix deps.compile", and "mix test" commands.` 这将打开一个命令提示符,其中设置了必要的环境变量,您将可以从中运行“ mix compile”,“ mix deps.compile”和“ mix test”命令。

Follow this line by line, and success is at your feet. 循序渐进,成功就在您脚下。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM