0

I have been getting this error when ever I have tried starting the server:

d:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/l ib/bcrypt.rb:16:in `require': cannot load such file -- bcrypt_ext (LoadError)

Funny thing is, I have had this error before and I solved it simply by running gem uninstall bcrypt,then gem uninstall bcrypt-ruby and then by running gem install bcrypt --platform=ruby (bcrypt gem was in the Gemfile). Now that I've added the pagination gems, the error has shown up again. I have tried a lot of possible solutions(like the ones listed here and some others).It didn't work. Here's the Gemfile(the important bit):

gem 'bcrypt', '~> 3.1.11'
gem 'will_paginate', '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'

Since I have a Rails 5 version,I know that these are not the final versions of the will-paginate and bootstrap-will_paginate gems and that I may not need the bootstrap-will_paginate gem.But I have tried both with the final versions(and without the bootstrap-will_paginate gem) and I have been getting the same error.Any help would be much appreciated(for the record,I work in Atom IDE on Windows 8.1).

sa77
  • 3,563
  • 3
  • 24
  • 37
ds998
  • 65
  • 1
  • 8
  • try removing Gemfile.lock `rm -rf Gemfile.lock` and running `bundle install` – sa77 Aug 12 '17 at 15:33
  • I still get the same error. – ds998 Aug 12 '17 at 15:51
  • https://stackoverflow.com/questions/29293321/ruby-on-windows-causes-error-cannot-load-such-file-bcrypt-ext/33593911#33593911 it's because you're using Windows – Richard Peck Aug 12 '17 at 20:13
  • Can you give me a pointer on how to properly install 'make'(or/and 'DevKit') because I don't have it and other instructions are pretty different from one user to another. – ds998 Aug 13 '17 at 14:31

1 Answers1

0

I solve it with uninstall all bcrypt gem versions with gem uninstall bcrypt and select option 3 (if exist) and uninstall all bcrypt-ruby gem versions with gem uninstall bcrypt-ruby and select option 3 (if exist) then install bcrypt using gem install bcrypt --platform=ruby then add this line gem 'bcrypt', platforms: :ruby or gem 'bcrypt', platforms: [:ruby, :x64_mingw, :mingw] to Gemfile, that is it :D.

Ashish Jambhulkar
  • 1,374
  • 2
  • 14
  • 26