REBAR3 installation in restrictive environments

This error comes up in restrictive environments.

Please is there a way to install from a downloaded copy?

C:\
λ mix local.rebar --force
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], :etimedout}]}

Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.

C:\
λ

EDIT: I’ve got rebar3 up and running on Windows by using the rebar3.cmd script from the rebar3 website.

C:\Paperless\aaa
λ rebar3 -v
rebar 3.22.0 on Erlang/OTP 26 Erts 14.2.3

Mix still complains it cannot find rebar3 … strange.

C:\Paperless\aaa
λ mix compile
==> uniq
Compiling 4 files (.ex)
Generated uniq app
==> aaa
Could not find "rebar3", which is needed to build dependency :elli
Shall I install rebar3? (if running non-interactively, use "mix local.rebar --force") [Yn] y
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], :etimedout}]}

Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.

C:\Paperless\aaa
λ
1 Like

Fetches a copy of rebar3 from the given path or URL.

It defaults to safely download a Rebar copy from Hex’s CDN.
However, a URL can be given as an argument, usually for an existing
local copy of Rebar:

  $ mix local.rebar rebar3 path/to/rebar

The local copy is stored in your MIX_HOME (defaults to ~/.mix)
according to the current Elixir. The installed version of Rebar will
be used whenever required by mix deps.compile.

Command line options

* `rebar3 PATH` - specifies a path for `rebar3`

* `--sha512` - checks the Rebar script matches the given SHA-512 checksum

* `--force` - forces installation without a shell prompt; primarily
  intended for automation in build systems like `make`

* `--if-missing` - performs installation only if not installed yet;
  intended to avoid repeatedly reinstalling in automation when a script
  may be run multiple times

Mirrors

If you want to change the default mirror
to use for fetching rebar please set the HEX_BUILDS_URL environment variable.

2 Likes