Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vagnerwentz opened this issue Mar 1, 2023 · 10 comments
Closed

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

vagnerwentz opened this issue Mar 1, 2023 · 10 comments

Comments

@vagnerwentz
Copy link

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
Copy link
Owner

riverrun commented Mar 2, 2023

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
Copy link

bopm commented Aug 11, 2023

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
Copy link

bopm commented Aug 11, 2023

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

@vagnerwentz
Copy link
Author

vagnerwentz commented Aug 11, 2023

@bopm How did you change?

@bopm
Copy link

bopm commented Aug 11, 2023

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

@riverrun
Copy link
Owner

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

@backspace
Copy link

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
Copy link
Owner

riverrun commented Dec 7, 2023

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

@perzanko
Copy link

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

@riverrun
Copy link
Owner

riverrun commented Oct 4, 2024

Closing this issue. If anyone feels like reopening, please let me know.

@riverrun riverrun closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants