简体   繁体   English

如何在Windows 8中安装,编译和使用Rebar

[英]How to install, compile, and utilize Rebar in Windows 8

Is this possible? 这可能吗?

All tutorials I've come across on how to build and use Rebar involve Unix commands, and I'm a most unfortunate Windows user. 我遇到的关于如何构建和使用Rebar的所有教程都涉及到Unix命令,而且我是一个非常不幸的Windows用户。 I'd really like to avoid installing Cygwin if I can help it. 如果我能帮忙的话,我真的很想避免安装Cygwin。

For example, to build Rebar you get: 例如,要构建Rebar,您将获得:

$ git clone git://github.com/rebar/rebar.git
$ cd rebar
$ ./bootstrap
Recompile: src/getopt
...
Recompile: src/rebar_utils
==> rebar (compile)
Congratulations! You now have a self-contained script called "rebar" in
your current working directory. Place this script anywhere in your path
and you can use rebar to build OTP-compliant apps.

What is the windows-cmd equivalent? 什么是windows-cmd等价物?

Any links or tutorial below to offer step by step instructions on how to utilize rebar in windows shell would be greatly appreciated. 下面的任何链接或教程提供有关如何在Windows shell中使用钢筋的分步说明将非常感激。

UPDATE: 更新:

After manually downloading and extracting Rebar to my directory located at: C:\\erlang\\rebar 手动下载并将Rebar解压缩到我的目录后,位于:C:\\ erlang \\ rebar

I go to the windows shell and enter: 我转到windows shell并输入:

SET PATH=C:\Program Files\erl5.10.1\bin

This is the 'bin' folder located inside the directory holding erlang.exe 这是位于包含erlang.exe的目录内的'bin'文件夹

Next I enter: 接下来我输入:

C:\erlang\rebar>bootstrap.bat 

Compiled! 编译了! :) :)

There should be a bootstrap.bat script in the rebar directory. rebar目录中应该有一个bootstrap.bat脚本。 You don't need cygwin for this to work, but you will need Erlang installed and on the path. 你不需要使用cygwin就可以了,但是你需要安装Erlang并且在路径上。

I assume you have erlang istalled already and added to your path. 我假设你已经有了erlang,并添加到你的路径中。

You can just download the Git and install it. 你可以下载Git并安装它。 Then open the git bash and type 然后打开git bash并输入

  • git clone https://github.com/rebar/rebar.git

  • once cloned it to your desired location then you can run the command by going inside the rebar directory. 一旦将其克隆到您想要的位置,您就可以通过进入rebar目录来运行命令。

    ./bootstrap ./bootstrap

  • Now it will work just fine and tell you that you have the rebar file compiled in your current working directory. 现在它可以正常工作并告诉您在当前工作目录中编译了rebar文件。

Nice you are good to go with using rebar for your project. 很高兴您可以使用钢筋为您的项目。

You can also just invoke path\\to\\erlang-install\\bin \\escript.exe bootstrap from a (Windows) command shell. 您也可以从(Windows)命令shell调用path \\ to \\ erlang-install \\ bin \\ escript.exe bootstrap

bootstrap is just an e(rlang) script. bootstrap只是一个e(rlang)脚本。

You can download and install Git for Windows Then, use it to run the same exact instructions: 您可以下载并安装Git for Windows然后,使用它来运行相同的确切说明:

git clone git://github.com/rebar/rebar.git
cd rebar
./bootstrap

and everything should work fine. 一切都应该工作正常。

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

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