riverrun / bcrypt_elixir

Bcrypt password hashing for Elixir
Other
161 stars 26 forks source link

bcrypt_elixir doesn't work even if we have C Compiler. #41

Open vagnerwentz opened 1 year ago

vagnerwentz commented 1 year ago

I use a Macbook M1 and I installed correctly about Elixir and Erlang.

elixir -v

Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]
Elixir 1.14.2 (compiled with Erlang/OTP 25)

When I try to use the bcrypt hash on terminal

Bcrypt.Base.hash_password("hard to guess", Bcrypt.Base.gen_salt(12, true))
[error] Process #PID<0.610.0> raised an exception
** (RuntimeError) An error occurred when loading Bcrypt.
Make sure you have a C compiler and Erlang 20 installed.
If you are not using Erlang 20, either upgrade to Erlang 20 or
use version 0.12 of bcrypt_elixir.
See the Comeonin wiki for more information.

    (bcrypt_elixir 3.0.1) lib/bcrypt/base.ex:15: Bcrypt.Base.init/0
    (kernel 8.5.2) code_server.erl:1317: anonymous fn/1 in :code_server.handle_on_load/5
[warning] The on_load function for module Elixir.Bcrypt.Base returned:
{%RuntimeError{
   message: "An error occurred when loading Bcrypt.\nMake sure you have a C compiler and Erlang 20 installed.\nIf you are not using Erlang 20, either upgrade to Erlang 20 or\nuse version 0.12 of bcrypt_elixir.\nSee the Comeonin wiki for more information.\n"
 },
 [
   {Bcrypt.Base, :init, 0,
    [file: 'lib/bcrypt/base.ex', line: 15, error_info: %{...}]},
   {:code_server, :"-handle_on_load/5-fun-0-", 1,
    [file: 'code_server.erl', line: 1317]}
 ]}

But I have the C Compiler installed

gcc --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
❯ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Does someone there is this error?

riverrun commented 1 year ago

I recommend you ask about this on https://elixirforum.com/ There are probably going to be several users there that have setup their Macbook M1, and they should be able to help you.

I might have more information for you next week, when I get a Macbook M1 myself.

bopm commented 1 year ago

I am facing the same issue with

Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]

Elixir 1.15.4 (compiled with Erlang/OTP 26)

by any chance, is there any followup for this issue?

bopm commented 1 year ago

Actually, ignore me, was running a shell in i386 mode due to the previous build.

vagnerwentz commented 1 year ago

@bopm How did you change?

bopm commented 1 year ago

I run arch which returned i386 so I reverted it back to my arch with arch -arm64 zsh.

riverrun commented 1 year ago

@vagnerwentz are you still having issues with this? Or did you find a fix?

backspace commented 9 months ago

I’m seeing the same thing on Erlang 25:

Erlang/OTP 25 [erts-13.2.2.4] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1]

Elixir 1.14.0 (compiled with Erlang/OTP 23)

I also tried 24 and making sure the Elixir version was compiled on the same Erlang version:

Erlang/OTP 24 [erts-12.3.2.14] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1]

Elixir 1.15.7 (compiled with Erlang/OTP 24)

This is on macOS 14.1.2 on an M1. Let me know if there’s anything else I can provide, thanks for all the work on this.

riverrun commented 9 months ago

I recommend that you ask on https://elixirforum.com/. There is a good chance that the developers there can help you with this.

perzanko commented 7 months ago

I'm experiencing the same issue. Have anyone solved that?