Today's Question:  What are you most afraid of as a programmer?        GIVE A SHOUT

Technical Article => Programming =>  Ruby

Fix issue "cannot load such file -- bcrypt_ext (LoadError)"

  sonic0002      2017-03-05 00:21:10      715    0    0

bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling passwords.

However, sometimes the rails application would fail to start after installing the bcrypt gem on Windows. The error would look similar to below.

The issue is that it fails to load the bcrypt_ext which is the native built extension, the reason may be the library is wrongly built. To fix this issue, below steps can be followed. 

  1. Open a command console
  2. cd to the gem directory C:\RailsInstaller\Ruby2.2.0\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri
  3. Run ruby extconf.rb. It should create the Makefile
  4. Run make. It will build the extension libraries.
  5. Run make install

The whole process looks like

Now if you start your application, you should see the issue is gone.

RUBY SOLUTION RUBY ON RAILS BCRYPT LOAD ERROR

  SAVE AS PDF   MARK AS READ   MARK AS IMPORTANT

Share on Facebook  Share on Twitter  Share on Google+  Share on Weibo  Share on Reddit  Share on Digg  Share on Tumblr    Delicious

  RELATED


  0 COMMENT


No comment for this article.


  WRITE ARTICLE

Project Ara, Another of Google’s Speculation. This time for modular phones

By hanryjames
Google is very adamant with the test of their new modular phones, nicknamed as Project Ara. The company is auspicious about the new concept where consumers can design their own phones by assembling parts from different manufacturers. The company is hopeful that there will be 20 to 30 interchangeable