Skip to content

Instantly share code, notes, and snippets.

@overture8
Last active January 9, 2018 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save overture8/370a9089473a643c3e47944e146ebfda to your computer and use it in GitHub Desktop.
Save overture8/370a9089473a643c3e47944e146ebfda to your computer and use it in GitHub Desktop.
Bcrypt NIF Issue

The following error was appearing when making use of bcrypt with the following versions on a Mac.

  • Elixir - 1.5.1
  • Erlang - 20.1
  • bcrypt_elixir - 1.0
        ** (EXIT) an exception was raised:
            ** (UndefinedFunctionError) function Bcrypt.Base.gensalt_nif/3 is undefined (module Bcrypt.Base is not available)
                (bcrypt_elixir) Bcrypt.Base.gensalt_nif([233, 62, 8, 4, 149, 169, 187, 161, 3, 67, 113, 26, 15, 100, 16, 225], 12, 98)
                (bcrypt_elixir) lib/bcrypt.ex:52: Bcrypt.gen_salt/2
                (bcrypt_elixir) lib/bcrypt.ex:85: Bcrypt.hash_pwd_salt/2
                (ecto) lib/ecto/multi.ex:422: Ecto.Multi.apply_operation/5 

The solution was to go into the deps/bcrypt_elixir folder and run:

make clean && make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment