无法在Windows命令提示符或git bash中运行iex

时间:2015-06-25 15:51:04

标签: elixir chocolatey

我刚在我的Windows 7机器上通过chocolatey安装了elixir。在C目录的根目录下,在管理员命令提示符下,我运行了:

c:\> cinst elixir

这成功安装了erlang和elixir - v.1.0.4。没有失败,所有成功的消息。然后我重新启动命令提示符并运行

c:\> iex.bat

我收到错误:

  

' iex.bat'不被识别为内部或外部命令,可操作程序或批处理文件。

我经常使用mac,所以在Windows方面我很无知。还尝试在git bash中运行iex,但没有运气。我如何运行iex?

1 个答案:

答案 0 :(得分:6)

Neither Erlang nor Elixir are automatically added to your path by Chocolatey. So make sure you add both Erlang's and Elixir's bin directory to your path. Since you mention that you're not really used to Windows, try running this at the command prompt before you try to execute iex.bat: SET PATH=C:/"Program Files"/erl6.4/bin;C:/Elixir/bin;%PATH% Obviously you'll want to adjust to the paths where you've installed things. Oh and you'll want to run iex.bat. I don't think iex.bat will run from a git bash prompt but I can't remember the last time I tried it. EDIT: For Elixir 1.0.5, you want to modify the path above to use C:/"Program Files"/erl7.0/bin (Erlang/OTP 18.0) assuming you've installed from Chocolatey. EDIT: Elixir is now added to the path on Windows (from Elixir 1.2.4) via the Chocolatey Nuget installer. Erlang may still need to be added manually; it's dependent on the Erlang Windows installer. Also @manveru's comment below no longer applies. ielixir.exe was a shim that was applied at one point to attempt to work around the path issues. It's been discontinued for a few versions now.