Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
489 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...