Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bcrypt 3.1.7 - Cannot load file on Windows #102

Closed
miguelpeniche opened this issue Oct 22, 2014 · 24 comments
Closed

Bcrypt 3.1.7 - Cannot load file on Windows #102

miguelpeniche opened this issue Oct 22, 2014 · 24 comments

Comments

@miguelpeniche
Copy link

Bcrypt stoped working for everything i am using in my app, in my case gems like Devise and Friendly_id are dependant of bcrypt, and them are not working anymore.

For the purpose of showing the error to you, i just create a new app named pr, uncomment the Gemfile line

gem 'bcrypt', '~> 3.1.7'

Then run command

bundle install

And trying to start the server

rails s

It explodes bad time! With the error

C:/Ruby21/lib/ruby/gems/2.1.0/gems/bcrypt-3.1.7-x86-mingw32/lib/bcrypt.rb:16:in `require': cannot load such file -- bcrypt_ext (LoadError)

This is the screenshot

captura de pantalla 2014-10-22 17 27 57

I am using the next:

  • Window 7 64 bits system
  • Rails 4.1.6
  • ruby 2.1.3p242 (2014-09-19 revision 47630) [i386-mingw32]

Hope there is some fix for this issue soon.

@tjschuck
Copy link
Collaborator

3.1.7 is not built with support for Ruby 2.1 on Windows. I'm building 3.1.8 now and should have it pushed up shortly.

@miguelpeniche
Copy link
Author

@tjschuck glad you can help me, i am on a trip, and the only laptop i have is Windows. Thanks for the contribution.

@tjschuck
Copy link
Collaborator

@mickeycinema I just pushed version 3.1.8 to RubyGems. Can you please confirm that it works for you? Thanks!

@miguelpeniche
Copy link
Author

Still not working :/, i did the same steps as the start, with a new app called brcyptapp, but now updated the line

gem 'bcrypt', '~> 3.1.8'

Here is the screenshot:

captura de pantalla 2014-10-23 16 11 49

@tjschuck
Copy link
Collaborator

@mickeycinema Ugh, sorry. Give 3.1.9 a try...

@miguelpeniche
Copy link
Author

Now everything is working like a charm with bcrypt 3.1.9!
May i reopen this issue if i see any bug?
Thanks a lot for your help.

@tjschuck
Copy link
Collaborator

@mickeycinema If it seems related, sure -- comment back on this issue. If it's unrelated, feel free to open a new issue.

Thanks!

@gilbertc77
Copy link

Got some error related to bcrypt when running rails s on win8.1 64bit, ruby 2.2.2, rails 4.2.1
bcypt_ext error

@ccoenen
Copy link

ccoenen commented Jul 1, 2015

(sorry, just saw #116, adding my voice there)

@pranjal815
Copy link

I don't know but this is very strange. Whenever i mentioned following code in my Gemfile rails server stops working and when I comment the code it is working. I tried installing , updating and everything but bcrypt seems to be not working for me.

The code that I mentioned in the gem file is as follows:
gem 'bcrypt', '~> 3.1.9'

If I comment or delete the above line then "rails s" command is working.

I am using devise for authentication but when I entered username and password i get "LoadError in Devise::SessionsController#create" error in the web console in the rails server log I get "LoadError (cannot load such file -- bcrypt_ext):" error. Following is the screenshot of the error.
screencapture-localhost-3000-authors-sign_in-1487686213516

@ccoenen
Copy link

ccoenen commented Feb 21, 2017

@pranjal815 this is a quite old ticket, you're not very likely to get help in those cases. I would always open a new ticket unless it's very much the same thing. Also, this would be better suited for Stackoverflow's Q&A Style questions rather than GitHubs Issues.

Try adding '3.1.9' with no ~> to your Gemfile, this will freeze it to a specific version. Then do a bundle install.

Right now, you're running bcrypt 3.1.11 which may or may not be broken again. (you can tell from the path in your stacktrace, 5th and 6th line).

The leading ~> gives bundler some leeway in choosing a version for you. This is described in the bundler docs.

@ladyruby723
Copy link

@pranjal815 I had a very similar issue, and adding the github version of bcrypt to my Gemfile seemed to fix the problem. :)

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

@dafeed
Copy link

dafeed commented Mar 13, 2017

@ladyruby723 I made an account just to thank you. I'm going through Lynda.com's Ruby Course on Windows 7 and bcrypt wasn't working at all. Just using the latest version of bcrypt made it so I couldn't use the rails server, couldn't create users in the console, nothing. So I googled around like crazy for over 3 hours and tried all the different "solutions" like changing the platform to ruby, using a different version, blah blah blah. But no matter what I did, the password_digest would never work. I could add a password but it wouldn't encrypt it. UNTIL I did what you said. I uninstalled all the bcrypt and bcyrpt-ruby gems and then added the line you provided into the gemfile and then ran bundle install and holy crap, everything worked after that. So again, thank you so much for putting this here. For whatever reason it seems the github version is happy on my windows machine. WOOT!

@cfkwok
Copy link

cfkwok commented Mar 14, 2017

@ladyruby723 Thank you sooo much!!! I was about to dual boot Linux here...

@ericremer
Copy link

@ladyruby723 Thank you... everything else failed, but your solution worked!

@TheHeavenlyDao
Copy link

@ladyruby723 THANK YOU! I've been looking for a solution for so long, but your solution worked! Thank you very much!

@gaumondia
Copy link

gaumondia commented Mar 19, 2017

@ladyruby723 THANK YOU!! I got an error at first but then realized I had to install https://git-scm.com/downloads before. Worked like a charm! :)

@ccoenen
Copy link

ccoenen commented Mar 19, 2017

I sympathise with everyone who has problems. I really do. I had my fair share myself. This ticket is not the place to get your issues fixed. Open a new ticket with your specific problem or post them to stackoverflow.

For one thing: this ticket is closed. Sadly, Github only shows this at the very top of the ticket, not at the place where you're likely to start reading. It only gets attention from people who are for some reason still subscribed to it. The developers very likely don't monitor closed tickets.

Another reason, why this is the wrong ticket: It is also about a different topic for the most part. At the very least because the versions are different. Probably also because your version of ruby today is not the same it was three years ago.

The Third reason is this: the devs don't see your problem (for the reasons above), so they can't acknowledge that bcrypt is one of the major stumbling blocks for ruby (on rails) newcomers. I've been lucky enough to be instructor in four different Ruby beginners events. A large portion of the participants are windows users. Pretty much all of them run into problems like yours. This will only get fixed if these problems are reported. Every new problem deserves a new ticket.

@ghost
Copy link

ghost commented May 20, 2017

ladyRudy Thank you. It worked like charm.

@farzam7777
Copy link

@ladyruby723 Thank you so much. Your solution worked for me.

@steph1793
Copy link

Thank you a lot @ladyruby723 . It also worked for me after 7 hours trying to fix this.

@franbach
Copy link

Thank you! @ladyruby723

@Ryanrj
Copy link

Ryanrj commented Jan 23, 2018

@ladyruby723 Thank you!!

@ksb777
Copy link

ksb777 commented Jan 24, 2018

I think nobody can solve this problem.......I did everything to solve this problem but bcrypt's issue is not solved.
damn issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests