no such file to load -- bcrypt_ext (via devise) - ruby-on-rails

I'm using database authentication in devise(current gem) on rails 3 and I get the following error when trying to log in with username/password.
no such file to load -- bcrypt_ext
This error occurred while loading the following files:
bcrypt
bcrypt_ext
I have previously "Successfully installed bcrypt-ruby-2.1.2" gem.
Any ideas? I also tried giving bundler the git repo address and fetching the master, but it doesn't solve the issue.

I had this problem as well. When I installed the gem, the output told me
Building native extensions. This could take a while...
Successfully installed bcrypt-ruby-3.0.1
so I assumed that it had, in fact, built native extensions. But when I went hunting in .../gems/bcrypt-ruby-2.1.4/ext/mri I saw that it not appear to have built anything.
I manually went in and ran
cd [path to your gems folder]/gems/bcrypt-ruby-2.1.4/ext/mri
ruby extconf.rb
make
sudo make install
This did the trick for me.

Do you have these in your Gemfile?
gem "bcrypt-ruby", :require => "bcrypt"
Also -- this issue on devise might apply, check it out

I had the same problem.
add in gemfile:
gem "bcrypt-ruby", '~> 3.0.0'
try bundle install and then bundle update bcrypt-ruby

I had the same issue, i simply deleted the vendor directory and did bundle install.
Fixed the problem. Maybe theres a problem in the make where it won't overwrite.

Check out your Gemfile. See whether you have "bcrpyt-ruby" gem or not. If it is not there then add "bcrpyt-ruby" gem.
gem "bcrypt-ruby", :require => "bcrypt"

I too had the same issue, this resolved it-
gem 'bcrypt', '~> 3.1.9'

Related

Problem when installing rails on windows?

I am trying to create new demo rails program, as guide in my book as this command
rails new demo
then it gave me this error
https://imgur.com/rUSzO4B
It said that my problem is
Could not find gem sqlite3 <> 1.4 x86-mingw32 in any of the gem sources listed in your Gem file
and I must run
bundle install
to solve it
I ran bundle install , but nothing changed.
I know my question maybe too easy to solve, but I am very stuck with this, could you please give me some ideas?
From the documentation of the bootsnap gem in rails: "This gem works on macOS and Linux." See: https://github.com/Shopify/bootsnap
They seem to have found a workaround here:
How can I properly install bootsnap on windows
Add or change to gem 'bootsnap', '=1.4.1', require: false to your project Gemfile

Cannot load such file bcrypt_ext

I am running rails in windows 10 and when I try to log in I'm getting bcrypt load error. I used to get this error before but I used to solve it. But this time I am not able to. I have tried all the solution by installing bcyrpt gem but nothing is working for me. I am stuck with this. Can anybody help me
I have referred this before
Ruby on windows causes error Cannot load such file bcrypt_ext
For Windows 10, try to use bcrypt 3.1.11
Uninstall older bcrypt and bcrypt-ruby
Install it again by adding following line in Gemfile
gem 'bcrypt', '~> 3.1.11'
Then bundle install

Add Gem 'wdm' to your GemFile

Error
I have tried running the following command in git bash
rails g scaffold_controller oragnizationsController
And I get the error in the picture.
I have tried multiple solutions:
1- Tried running
gem install wdm
2- Tried running
bundle install
3- I have tried adding
gem 'wdm', '~> 0.1.0'
and
gem 'wdm', '~> 0.1.1'
since I read that 0.1.0 ain't working anymore.
But the problem hasn't been solved yet. I am using windows 10, ruby 2.3.3, rails 5.1.4
Uninstall wdm gem and put it to the gemfile like this:
gem 'wdm' if Gem.win_platform?
Or like the error tells you
The message about wdm is misleading here. It seems to be just a notice/warning.
If you look closer, you'll see that the actual error message is printed in the line below that. It says:
cannot load such file -- bcrypt_ext (LoadError)
Then see here: Ruby on windows causes error Cannot load such file bcrypt_ext

Rails: Bundle install not working

I've generated the app with "rails new" and switched to that directory but when I try to use "bundle install" I get
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
continue.
Make sure that gem install debug_inspector -v '0.0.2' succeeds before
bundling.
any suggestions?
I had the same problem with my rails application. I'm running with JRuby on my Windows machine and this is a common problem for Windows. I had to find the gem which included that gem as a dependency and remove it from my gem file.
In my case, there was a gem causing this name : gem 'web-console', '2.0.0.beta3' (probably an old version of the gem since it's a 1 year old project).
You probably need to comment some gem and try to bundle until it works.
If the gem is essential to the project, you will have to find a way to compile the gem for windows.
It may exist a way to check a tree of dependency to speed up the process.
This is a common error in older versions of ruby. Updating ruby version to 2.1.0 or later will fix this issue.

Ruby on Rails 4, Gem Install

I have had a lot of difficulty installing Gems into my Rails 4 Apps that I have built. For example, I have recently had issues with these two Gems:
Ckeditor:
https://github.com/galetahub/ckeditor
Twitter Bootstrap 3:
https://github.com/twbs/bootstrap-sass
I have no idea what I am doing wrong, in the slightest. I include the gems in my Gem file (gem 'ckeditor_rails'), and then I run 'bundle install'. However, whenever I provide my includes in my application.js (example: '//= require ckeditor/init'), my app yells at me and tells me that it cannot resolve the file. When I check why, its because no file was ever downloaded. Even though the gem installed with no errors. I have got to think I am doing something wrong. Any advice?
Before installing gem, first noted if there is any dependency gem. if the gem having dependency gem means you must install it first. and you may edit in your project/gem file gem 'ckeditor' and gem 'bootstrap-sass' and then run the server.

Resources