Windows

Mitja Bezenšek edited this page Nov 28, 2015 · 2 revisions

All things related to Elixir on Windows.

Building

The recommended way to build Elixir on Windows is with tools provided by MinGW and MSYS. Although MinGW is used for building Elixir, it is not necessary for running Elixir. In addition to MinGW, you'll need Git and Erlang on your system.

Installing MinGW

First, if you don't already have the MinGW Installation Manager on your system, download mingw-get-setup.exe here and run it. This will provide a package manager interface from which you can install the necessary MinGW/MSYS components. In the interface, mark the following packages for installation:

  • msys-bash (bin)
  • msys-grep (bin)
  • msys-make (bin)

Then, in the Installation menu, select Apply Changes.

Finally, you'll need to add the directory containing these packages to your system's Path environment variable. By default the path is C:\MinGW\msys\1.0\bin. To do this:

  1. Press Win + R to open the Run dialog
  2. Type "SystemPropertiesAdvanced.exe" and press Enter.
  3. Click "Environment Variables..."
  4. Under "System variables", select "Path" and then click "Edit..."
  5. Append the directory to the variable value, using a semicolon to separate the directory form the other entries.
  6. Click "OK" in each of the open windows.

Installing Git

If you don't already have Git installed, you can download it here and install it. A directory containing git.exe needs to be in your Path environment variable (see above for how to add it). By default, the installation puts git.exe in C:\Program Files (x86)\Git\cmd.

Installing Erlang

If you don't already have Erlang installed, you can download it here and install it. A directory containing erl.exe needs to be in your Path environment variable (see above for how to add it). By default, the installation puts erl.exe in C:\Program Files\erlX.Y\bin or C:\Program Files (x86)\erlX.Y\bin.

Compiling Elixir

Once you have the necessary tools, open up a Command Prompt in your favorite directory and follow these steps to compile Elixir:

  1. Clone the Elixir repo to your system using git clone https://github.com/elixir-lang/elixir.git
  2. Change into the repo directory using cd elixir
  3. Run make.

It's that simple!

Gotchas

Here are some snags you might run into while working with Elixir on Windows.

  • Symlinks creation requires Administrator privileges; File.ln_s/2 will return {:error, :eperm} if the associated erl.exe or werl.exe process is not running as an Adminsitrator.
  • Paths with backslashes aren't supported because the backslash is used for escape characters. For example, C:\Users\Chris doesn't work, but C:/Users/Chris or C:\\Users\\Chris do.