LoginSignup
2
0

makeとgccのインストール方法

Posted at

以下のElixirの記事を後追いしていたら環境絡みの問題に遭遇

mix ecto.migrateをした際に以下のエラーが出力された

mix ecto.migrate
==> bcrypt_elixir
mkdir -p "/home/ricky/elixir_auth/bright/_build/dev/lib/bcrypt_elixir/priv"
cc -g -O3 -Wall -Wno-format-truncation -I"/usr/lib/erlang/erts-13.0.4/include" -Ic_src -fPIC -shared c_src/bcrypt_nif.c c_src/blowfish.c -o "/home/ricky/elixir_auth/bright/_build/dev/lib/bcrypt_elixir/priv/bcrypt_nif.so"
/bin/sh: 1: cc: not found
make: *** [Makefile:33: _lib_name] Error 127
could not compile dependency :bcrypt_elixir, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile bcrypt_elixir --force", update it with "mix deps.update bcrypt_elixir" or clean it with "mix deps.clean bcrypt_elixir"
==> bright
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. If you are using
Ubuntu or any other Debian-based system, install the packages
"build-essential". Also install "erlang-dev" package if not
included in your Erlang/OTP version. If you're on Fedora, run
"dnf group install 'Development Tools'".

どうやらmakeとgccを予め入れておかないとうまくいかないらしい
makeは

sudo apt install make

通ったけどgccが環境依存か

sudo apt install build-essential

sudo apt install gcc

でもうまくいかなかった

ubuntuの質問をのぞいたらあった

$ sudo apt purge gcc
$ sudo apt-get autoremove
$ sudo apt update
$ sudo apt upgrade
$ sudo apt full-upgrade
$ sudo apt install gcc

これでうまくいった
海外の誰かありがとう!

環境
Ubuntu 20.04.6 LTS
Elixir 1.16.2
Erlang/OTP 25

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0