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

Unitialized constant Bcrypt::Pasword #90

Closed
moofish32 opened this issue Feb 22, 2014 · 9 comments
Closed

Unitialized constant Bcrypt::Pasword #90

moofish32 opened this issue Feb 22, 2014 · 9 comments

Comments

@moofish32
Copy link

I have a gem that depends on Bcrypt and because I do not check in the Gemfile.lock for my gems my CI server just started failing. This failure may be truly on our side, but when I went to trace down my dependencies I found bcrypt and bcrypt-ruby; via Ruby Gems the source code links both point to this repo. The gems on disk are obviously not the same.

Can you explain a little about what is going on with the dependency between bcrypt and bcrypt-ruby (specifically for the java impl)? Right now if I change my gemspec to force bcrypt-ruby 3.1.2 everything passes, obviously pessimistic includes grab the change you just released (which looks safe).

I am using jruby and verified the same behavior on 1.7.8 - 10

I will do some more digging into this and see if there is a bug on my side (there probably is something with a require that we were getting lucky with), but I wanted to open a thread in case other people find similar issue. I'm happy to move this to a discussion group if you like.

@moofish32
Copy link
Author

Ok -- follow up I think something is corrupting your bcrypt.rb file for java. The one I am pulling down is garbage and if I replace that with what I see on github master all works.

@lephyrius
Copy link

Im also seeing this problem in jruby-1.7.10 / Rails 4 .

@murrekatt
Copy link

Same problem. bcrypt-ruby contains only a single constant: Dummy. No other BCrypt stuff available, hence the uninitialized constant for Password.

@murrekatt
Copy link

I use ruby 1.9.3 and Rails 3

@moofish32
Copy link
Author

I'm sure this is just an oversight, you have three work arounds right now:

  • lock your gem back to 3.1.2 (this is what I did)
  • where you previously require 'bcrypt' you need to require the files you see in bcrypt.rb (including the jar for jruby), the corruption is only bcrypt.rb that I can see
  • patch a local version and install locally or to a local gemserver and use this until fixed

@ghost
Copy link

ghost commented Feb 23, 2014

Same issue here, with 3.1.5. Locking it back to 3.1.2 solves it for me.

@tjschuck
Copy link
Collaborator

Can you explain a little about what is going on with the dependency between bcrypt and bcrypt-ruby

The gem was renamed from bcrypt-ruby to simply bcrypt -- see #86

To attempt backwards compatibility, a new version of the bcrypt-ruby gem was pushed that was an empty dummy gem, but has a dependency on bcrypt to load it.

However, this problem seems to happen on JRuby even when just bcrypt is installed, so I think -- think -- it's unrelated. But I'm looking into it. Thanks for reporting.

@tjschuck
Copy link
Collaborator

@moofish32 You're right, something seemed to be corrupt with the bcrypt.rb file, but just in the Java version. It appeared to be entirely unrelated to the renaming.

I just rebuilt and pushed version 3.1.7 of bcrypt to RubyGems -- please let me know if that fixes things for you.

Thanks! ❤️

@moofish32
Copy link
Author

@tjschuck - 3.1.7 works backwards compatible to the former bcrypt-ruby 3.1.2 for jruby (1.7.8-10).

Thanks for the quick fix and the details.

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

4 participants