Ask A Question

Notifications

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:
/tmp/bundler20180227-14591-12ywl1kbcrypt-3.1.11/gems/bcrypt-3.1.11/ext/mri
/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
inspection.
Results logged to
/tmp/bundler20180227-14591-12ywl1kbcrypt-3.1.11/extensions/x86_64-linux/2.3.0/bcrypt-3.1.11/gem_make.out

An error occurred while installing bcrypt (3.1.11), and Bundler cannot
continue.
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.
Reply
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.
Reply
Thank you so much! @William Kennedy Your suggestion helped a lot. The gem installed and is now working. Thanks!
Reply
Your welcome but I think it was you who did all the work. Glad it's working. 
Reply
Join the discussion
Create an account Log in

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

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

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