3

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
4

1 に答える 1

2

ここからいくつかの助けを借りて:

https://github.com/ninnines/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>
于 2015-10-12T23:30:35.783 に答える