Ask A Question


You’re not receiving notifications from this thread.

'bcrypt' gem install Error

Jayden Bamberger asked in Rails
So, I was attempting to install the gem 'bcrypt' and I received the following error:
Installing bcrypt 3.1.11 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/usr/bin/ruby2.3 -r ./siteconf20180227-14591-1t2kx3l.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/tmp/bundler20180227-14591-12ywl1kbcrypt-3.1.11/gems/bcrypt-3.1.11 for
Results logged to

An error occurred while installing bcrypt (3.1.11), and Bundler cannot
Make sure that `gem install bcrypt -v '3.1.11'` succeeds before bundling.
 I've already tried looking it up countless times and many of the answers on other websites weren't working. So if anyone is able to help, please do.
It looks like you are missing some development packages or dependencies.

sudo apt-get install ruby-dev

Are you on a mac? You may also need the command line tools. 

brew doctor can help in these situations.
Thank you so much! @William Kennedy Your suggestion helped a lot. The gem installed and is now working. Thanks!
Your welcome but I think it was you who did all the work. Glad it's working. 
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,168+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.