fast_secure_compare icon indicating copy to clipboard operation
fast_secure_compare copied to clipboard

require 'fast_secure_compare' fails

Open Umofomia opened this issue 10 years ago • 14 comments

When require 'fast_secure_compare' is called, it fails with LoadError: no such file to load -- fast_secure_compare. Because fast_secure_compare/rack and fast_secure_compare/rails eventually call this, they end up failing too.

It works if you instead do require 'fast_secure_compare/fast_secure_compare', so I'm guessing there's an issue with the directory in which the module definition lives.

Umofomia avatar Apr 30 '15 23:04 Umofomia

Weird.

I will investigate this as soon as I have a moment --- I have a full time job in a totally different field now, so it may take a little while.

daxtens avatar May 01 '15 00:05 daxtens

A minimal test case would be super helpful if you get the chance.

daxtens avatar May 01 '15 00:05 daxtens

@daxtens Thanks for responding. Simply cloning this repository and running rspec will hit this issue.

I'm not very familiar with writing gems with C extensions, but this guide appears to indicate:

lib/<name>.rb contains require '<name>/<name>' which loads the C extension

A lib/fast_secure_compare.rb file does not appear to exist with this line.

Umofomia avatar May 01 '15 00:05 Umofomia

Thanks, that's great. Optimistically I'm hoping to work on it this weekend: it sounds like it should be easy to fix.

I will also add that to the test suite so it doesn't get broken again.

daxtens avatar May 01 '15 00:05 daxtens

I tried forking your repo to see if I could implement the fix myself, but adding that file did not appear to be sufficient. Again I'm not very familiar with C extensions, so there might be something else I'm missing. Hopefully you'll have more luck. Thanks!

Umofomia avatar May 01 '15 00:05 Umofomia

I can confirm, creating a file lib/fast_secure_compare.rb with content

require 'fast_secure_compare/fast_secure_compare'

fixes the problem.

RKushnir avatar Jun 09 '15 15:06 RKushnir

Btw, mysteriously master contains version 1.0.0, while rubygems have 1.0.1. Where did they get it?

RKushnir avatar Jun 09 '15 15:06 RKushnir

Same problem as @RKushnir

blanchma avatar Jun 30 '15 19:06 blanchma

I'm sorry I haven't had time to look at this. I probably should just admit defeat at this point: is there anyone who would like to take over the project? @RKushnir?

Rubygem's 1.0.1 was just a version without binary gems, because they were messing things up. It's the same source.

daxtens avatar Jul 01 '15 03:07 daxtens

The workaround is require 'fast_secure_compare/fast_secure_compare'

2015-07-01 0:55 GMT-03:00 Daniel Axtens [email protected]:

I'm sorry I haven't had time to look at this. I probably should just admit defeat at this point: is there anyone who would like to take over the project? @RKushnir https://github.com/RKushnir?

Rubygem's 1.0.1 was just a version without binary gems, because they were messing things up. It's the same source.

— Reply to this email directly or view it on GitHub https://github.com/daxtens/fast_secure_compare/issues/2#issuecomment-117427519 .

blanchma avatar Jul 01 '15 15:07 blanchma

Is there a fork of this somewhere that actually works out of the box?

aurcioli-handy avatar Feb 19 '16 19:02 aurcioli-handy

@aurcioli-handy Check last commit in my fork https://github.com/RKushnir/fast_secure_compare It worked for me, but I was just guessing at a fix, so not sure if it's completely correct.

RKushnir avatar Feb 19 '16 19:02 RKushnir

Just out of interest, what are you thinking of using this for? Has this shown up in a benchmark? I'm just nervous about making this project any more usable because I don't have time to properly keep track of it.

daxtens avatar Feb 22 '16 00:02 daxtens

No worries, I don't need to use this project anymore. I read about it online though and thats how I came about it.

aurcioli-handy avatar Mar 31 '16 23:03 aurcioli-handy