Why Do I Get a Bcrypt-Ruby Gem Install Error

Failed to build gem native extension when installing bcrypt-ruby gem

I had to add a flag when installing:

gem install bcrypt-ruby -v '3.0.1' -- --with-cflags=-Wno-implicit-function-declaration

This installed the gem successfully with Ruby 2.7.2

gem install bcrypt (LoadError)

Kart-able;

try the following steps which worked for me:

  • remove anything related to bcrypt from your Gemfile
  • Enter the following information into your Gemfile

    gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'

Run 'bundle install' at the root of your project and it should work.

Error stating that bcrypt-ruby is not part of the bundle , how can I add bcrypt-ruby to Gemfile?

As the message says you need to add bcrypt-ruby to your Gemfile (at the root of the project).

Adding

gem "bcrypt-ruby"

and then running bundle install should do the trick (this would fetch the gem if you hadn't already installed it).

You can specify specific versions to, eg

gem "bcrypt-ruby", "~> 3.0.1"

will get you the latest version that is >= to 3.0.1 but less than 3.1. You might do this if 3.0.1 has a bug fix you depend on and you're happy to get more bug fixes but you don't want major changes. There's loads more info on the bundler website.

bcrypt loading error in windows 10

It took me few hours to get this done but please feel free to share it.The root problem here is that ruby itself comes with bcrypt version 3.1.5 which is having bugs with the newer updates. However when you install or uninstall the bcrypt you are leving behind bcrypt-ruby which it always asks for first and hence all what you are doing won't go through so what to do ? 1- uninstall bcrypt and bcrypt-ruby by running these two commands:
gem uninstall bcrypt
and

 gem uninstall bcrypt-ruby

2- Install it again with

gem install bcrypt --platform=ruby 

In your Gemfile write

 gem 'bcrypt','~>3.1.11' 

NOW as i write these lines the latest version is 3.1.11 but whatever version is updated just add it from their gem page. Run bundle install and it should work just fine.

Can't figure out how to get 'bcrypt' working in ruby on rails (WIN 10)

Try fixing your gemfile. You're working in a 64 bit operating system, but you've specified a 32 bit version of bcrypt in your gemfile:

bcrypt (3.1.7 x86-mingw32)

This notation leads to a cascade of problems because bcrypt wants to install 32 bit dependencies (psych) as well.

Specify the 64 bit version of bcrypt in your gemfile and see what happens:

bcrypt (3.1.7-x64-mingw32)

Then run:

bundle install

You should be in good shape from there on out. I'm not sure, since I'm too lazy to boot into Windows at the moment, but I think you can probably get away with not specifying a version of bcrypt at all, and letting bundler figure it out by itself based on your platform.



Related Topics



Leave a reply



Submit