Reputation: 395
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.
Upvotes: 8
Views: 11008
Reputation: 4485
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"
Upvotes: 0
Reputation: 514
I had the same problem.
add in gemfile:
gem "bcrypt-ruby", '~> 3.0.0'
try bundle install and then bundle update bcrypt-ruby
Upvotes: 3
Reputation: 1006
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.
Upvotes: 0
Reputation: 4359
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.
Upvotes: 11
Reputation: 40277
Do you have these in your Gemfile?
gem "bcrypt-ruby", :require => "bcrypt"
Also -- this issue on devise might apply, check it out
Upvotes: 8