【问题标题】:What are the steps to successfully run Ranch on windows?在 Windows 上成功运行 Ranch 的步骤是什么?
【发布时间】:2016-01-09 22:02:47
【问题描述】:

请问我们需要采取哪些步骤才能让 Ranch 在 Windows 上成功运行?

在一个很棒的博客系列中有一组非常有启发性的例子,我想在这里学习:

http://dbeck.github.io/Using-Ranch-From-Elixir/

http://dbeck.github.io/simple-TCP-message-performance-in-Elixir/

然而,它要求我们使用 Ranch Erlang Lib。

到目前为止,让它在 Windows 上运行一直很痛苦:

mix.deps.compile 失败

C:\Elixir\tcp_eval>mix deps.update --all
Running dependency resolution
Dependency resolution completed successfully
  ranch: v1.1.0

C:\Elixir\tcp_eval>mix deps.compile
==> ranch
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - SRC
File not found - -TYPE
File not found - F
File not found - -NAME
File not found - SRC/
File not found - -TYPE
File not found - F
File not found - -NAME
Access denied - EBIN
File not found - -TYPE
File not found - F
File not found - -NAME
 APP    ranch.app.src

【问题讨论】:

  • 看起来 Ranch 的 makefile 运行 find 并希望它是 Unix 版本,但它却获得了 Windows 版本,实际上更像 grep
  • 我会在msys64环境再试一次
  • @|peer-stritzinger 看到你编辑了。如果我们可以让 Ranch 在 Windows 上运行,那么我们可以应用与其他使用 erlang.mk 的 erlang 库相同或相似的应用程序。所以从某种意义上来说,也是一个erlang相关的帖子。

标签: windows erlang elixir elixir-mix ranch


【解决方案1】:

这里有一些帮助:

https://github.com/ninenines/erlang.mk/issues/294#issuecomment-147379818

我能够让 Ranch 在 Windows 上工作。

1) 安装msys2环境

2) 在 MSYS2 环境中运行 mix

编辑:通过钢筋执行此操作

D:\Elixir\tcp_eval>rebar
'rebar' is not recognized as an internal or external command,
operable program or batch file.

D:\Elixir\tcp_eval>rebar3
Rebar3 is a tool for working with Erlang projects.


Usage: rebar [-h] [-v] [<task>]

  -h, --help     Print this help.
  -v, --version  Show version information.
  <task>         Task to run.


Several tasks are available:

as                Higher order provider for running multiple tasks in a sequence as a certain profiles.
clean             Remove compiled beam files from apps.
compile           Compile apps .app.src and .erl files.
cover             Perform coverage analysis.
ct                Run Common Tests.
deps              List dependencies
dialyzer          Run the Dialyzer analyzer on the project.
do                Higher order provider for running multiple tasks in a sequence.
edoc              Generate documentation using edoc.
escriptize        Generate escript archive.
eunit             Run EUnit Tests.
help              Display a list of tasks or help for a given task or subtask.
new               Create new project from templates.
path              Print paths to build dirs in current profile.
pkgs              List available packages.
release           Build release of project.
relup             Create relup of releases.
report            Provide a crash report to be sent to the rebar3 issues page.
shell             Run shell with project apps and deps in path.
tar               Tar archive of release built of project.
tree              Print dependency tree.
unlock            Unlock dependencies.
update            Update package index.
upgrade           Upgrade dependencies.
version           Print version for rebar and current Erlang.
xref              Run cross reference analysis.

plugins <task>:
  list           List local and global plugins for this project
  upgrade        Upgrade plugins

unstable <task>:
  install        Extract libs from rebar3 escript along with a run script.
  upgrade        Download latest rebar3 escript and extract.

Run 'rebar3 help <TASK>' for details.

D:\Elixir\tcp_eval>

查看 Hex.pm,我决定安装 rebar3,它可以很好地工作/与 mix 集成。

按照http://theburningmonk.com/2014/08/getting-started-with-rebar-on-windows/,我们可以让rebar3在windows上工作

但这仍然不起作用:

D:\Elixir\tcp_eval>mix deps.compile
==> ranch
'make' is not recognized as an internal or external command,
operable program or batch file.
==> tcp_eval
** (Mix) Could not compile dependency :ranch, "make" command failed. You can recompile this dependency with "mix deps.compile ranch",

D:\Elixir\tcp_eval>

【讨论】:

  • 您应该能够在不使用 Msys 的情况下使其正常工作。你有安装钢筋吗?
  • @OnorioCatenacci 看到这个:D:\Elixir\tcp_eval&gt;mix deps.compile ==&gt; ranch 'make' is not recognized as an internal or external command, operable program or batch file. ==&gt; tcp_eval ** (Mix) Could not compile dependency :ranch, "make" command failed.
  • @OnorioCatenacci 即使在安装 rebar 之后,Windows 上仍然没有默认的“make”
  • Windows 上不会有默认的“make”。您需要安装 gnu make 或 Visual Studio make(如果有记忆,实际上称为 nmake)或其他东西。另外,它也需要添加到路径中。
  • 在命令提示符下键入“rebar”(减去双引号)。发布你得到的内容作为对你问题的编辑。钢筋需要在您的路径中,并且需要正常工作才能让 Ranch 继续前进。
猜你喜欢
  • 2018-03-21
  • 2013-04-12
  • 2019-11-06
  • 1970-01-01
  • 1970-01-01
  • 2015-07-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多