1

I have received a project that already has a lot of Elixir and JS code in it. I don't have any experience in Elixir but i need to try and fix some bugs.

I'm struggling to set the project up on my windows machine. Erlang, Elixir and Postgres are installed successfully, and i can also run mix deps.get successfully.

But when i run mix ecto.setup i get:

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

All I find online are errors related to installation of visual studio or C++, which i don' think is the case here as it is installed and mix deps.get works well.

Here is the mix.exs file:

defmodule Boilerplate.Mixfile do
  use Mix.Project

  def project do
    [
      app: :boilerplate,
      version: "0.0.1",
      elixir: "~> 1.6",
      elixirc_paths: elixirc_paths(Mix.env()),
      compilers: [:phoenix, :gettext] ++ Mix.compilers(),
      start_permanent: Mix.env() == :prod,
      aliases: aliases(),
      deps: deps()
    ]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [
      mod: {Boilerplate.Application, []},
      extra_applications: [:logger, :runtime_tools, :comeonin]
    ]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [
      {:phoenix, "~> 1.3.4"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 3.5"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.12"},
      {:phoenix_live_reload, "~> 1.1", only: :dev},
      {:gettext, "~> 0.16"},
      {:credo, "~> 0.10", only: [:dev, :test], runtime: false},
      {:cowboy, "~> 1.1"},
      {:comeonin, "~> 4.1"},
      {:bcrypt_elixir, "~> 1.1"},
      {:plug_cowboy, "~> 1.0"},
      {:guardian, "~> 1.1"},
      {:timex, "~> 3.1"},
      {:floki, "~> 0.20.0"},
      {:httpoison, "~> 1.4"},
      {:porcelain, "~> 2.0"},
      {:edeliver, "~> 1.4.2"},
      {:distillery, "~> 1.4"},
      {:logger_file_backend, "~> 0.0.10"},
      {:scrivener_ecto, "~> 1.0"},
    ]
  end

  # Aliases are shortcuts or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    [
      "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
      "ecto.reset": ["ecto.drop", "ecto.setup"],
      test: ["ecto.create --quiet", "ecto.migrate", "test"]
    ]
  end
end

Edit:

This is the results of running deps.compile bcrypt_elixir

$ mix deps.compile bcrypt_elixir
==> bcrypt_elixir
could not compile dependency :bcrypt_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile bcrypt_elixir", update it with "mix deps.update bcrypt_elixir" or clean it with "mix deps.clean bcrypt_elixir"
==> boilerplate
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.
yoni349
  • 107
  • 1
  • 15
  • 1
    Are you using Windows ? Check [this](https://stackoverflow.com/questions/35507646/nmake-exe-is-not-found-in-the-windows-system32-folder-how-to-setup-nmake-comman). – David Magalhães Feb 24 '20 at 14:17
  • Have installed Visual Studio community and "Desktop development with C++ " from the tool installation option. I do see the nmake.exe under: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64 But still get the same error. – yoni349 Feb 24 '20 at 17:56
  • Did you try any of the suggestions in the error message? – 7stud Feb 25 '20 at 16:18
  • Yes, no effect. – yoni349 Feb 25 '20 at 16:59
  • Please not that `mix deps.get` only downloads the dependencies to the `deps` directory *without* compiling them. So when you run `mix ecto.setup`, since it's the first command that requires the deps and your project to be compiled, mix tries to compile the deps for the first time. Can you double check if the path of `nmake` is in your `$PATH` environment variable? Maybe something like `echo %PATH%` (Haven't used windows for a while, not 100% sure about this command) – wiser Feb 27 '20 at 06:24
  • Also can you post what happens when you run `mix deps.compile bcrypt_elixir`? – wiser Feb 27 '20 at 06:28
  • @wiser see edit in above for the results. – yoni349 Mar 01 '20 at 15:29
  • @wiser, i dont think that nmake is in the path, see print screen https://prnt.sc/r9vzsi. any idea how to fix it? – yoni349 Mar 01 '20 at 15:36
  • @yoni349 I reckon adding `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64` to the PATH env var should do. – wiser Mar 02 '20 at 11:54
  • Also you might want to have a look at [this question](https://stackoverflow.com/questions/35507646/nmake-exe-is-not-found-in-the-windows-system32-folder-how-to-setup-nmake-comman?noredirect=1&lq=1) – wiser Mar 02 '20 at 11:56

0 Answers0