| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Same problem here...
Just got this issue again. The only solution right now is to run:
gem uninstall bcrypt gem install bcrypt --platform=ruby
I suppose it's just a temporary fix.
I already tried that, this doesn't fix the problem for me. I did this to be able to start the server at all, but when using my model with has_secure_password the exception still occurs.
How about this?
gem list bcrypt
what about it? It outputs the gems:
gem list bcrypt
*** LOCAL GEMS ***
bcrypt (3.1.11)
Hmm...
Are there bcrypt_ext.* in the subdirectories of C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11/ext ?
Subfolder jruby just contains another folder bcrypt_jruby with a BCrypt.java, other folder is mri with the following content:
Verzeichnis von C:\RailsInstaller\Ruby2.3.0\lib\ruby\gems\2.3.0\gems\bcrypt-3.1.11\ext\mri
06.03.2017 09:50 <DIR> .
06.03.2017 09:50 <DIR> ..
06.03.2017 09:50 0 .RUBYARCHDIR.time
06.03.2017 09:50 24 bcrypt_ext-i386-mingw32.def
06.03.2017 09:49 1.540 bcrypt_ext.c
06.03.2017 09:50 8.837 bcrypt_ext.o
06.03.2017 09:50 33.280 bcrypt_ext.so
06.03.2017 09:49 1.062 crypt.c
06.03.2017 09:49 268 crypt.h
06.03.2017 09:50 8.668 crypt.o
06.03.2017 09:49 26.325 crypt_blowfish.c
06.03.2017 09:50 74.787 crypt_blowfish.o
06.03.2017 09:49 3.348 crypt_gensalt.c
06.03.2017 09:50 4.785 crypt_gensalt.o
06.03.2017 09:49 417 extconf.rb
06.03.2017 09:49 7.941 Makefile
06.03.2017 09:49 998 ow-crypt.h
06.03.2017 09:49 7.098 wrapper.c
06.03.2017 09:50 8.065 wrapper.o
17 Datei(en), 187.443 Bytes
2 Verzeichnis(se), 753.023.946.752 Bytes frei
Sorry for the bad formatting, the tabs are getting truncated.
I just noticed, when really uninstalling and reinstalling bcrypt it works, the problem is that after running bundler install the wrong bcrypt get's installed. I just don't understand why.
Installing with gem install bcrypt --platform=ruby is working, and my gemfile contains gem 'bcrypt', '~> 3.1.7', platforms: :ruby but breaks the installation. What do I need to write there to be equivalent?
hello, just had the same problem, and solved it, with uninstall - install solution provided from issue 142 The way it worked for me is in the gem file I commented out # gem bcrypt, '3.1.11' and run bundle install... after that UnCommented gem 'bcrypt', '3.1.11', platforms: [:ruby, :x64_mingw] and again bundle install and that's it. Hope this helps someone..
P.S :x64_mingw is for 64x Windows. I am on win7x64
@hellrider200 somehow that didn't work on my end and the solution listed here worked instead #102
Hopefully it helps someone else too!
@gaumondia yeah but referencing the github version isn't exactly something I want to do when the project goes into production...
I solved it based on hellriders solution.First of all comment out # gem bcrypt, '3.1.11' and run bundle install.After that uninstall the gem with gem uninstall bcrypt.Then re-install gem install bcrypt --platform=ruby.The important part, un-comment gem 'bcrypt', '~> 3.1.11', platforms: [:ruby, :x64_mingw, :mingw] and then bundle install.Thats it.Note the mingw part at the end.This should be the key.
P.S i think bcrypt is running on 32bit environment regardless of your operating system.
P.S 2 Yeah bundle install breaking bcrypt somehow.Temporary solution is commenting out gem 'bcrypt' everytime before bundle install and then un-comment.I hope it will be fixed soon, it is so dumb.
@overload77 it seems as if this solves my problem with bundler reinstalling the wrong gem, even though I don't really understand why... thanks, anyways!
@TheFlow0360 glad you solved it as well, one thing though, now when you want to install new gem for the given project, install it with the gem install command, because if you do it with bundle install it will see the extensions/options for bcrypt ie. platforms: [:ruby, :x64_mingw, :mingw] and will install the gem for those platforms meaning for :x64_mingw, :mingw and it will error again
So when using gem install, bundler will not install just use the new gem and it will not see the bcrypt extensions/options... try that and tell if it worked...
Is there any solution that for good and all fix the problem on windows?
AFAIK, the only solution to fix this problem once and for all is rebuild the gem locally (all other solutions seem to be temporary and were not very effective for me - for instance, everything started to break again after doing bundle updates). Perform the following steps:
Note that steps 4 and 5 should be performed from MSYS command line interface if you are not using DevKit (that is, for newer Rubies)! In order to properly open this terminal run F:\msys64\msys2_shell.cmd -mingw64 (if you're using Windows x64). Hopefully this helps, and best of luck.
Hi,
I'm still having this issue on my windows. I run windows 10 and use the railsinstaller 3.4.0 (which includes ruby 2.3.3).
I get the error LoadError (cannot load such file -- bcrypt_ext): when I log in to my site and not when the server is started.
I use Devise gem which installs bcrypt-3.1.11-x86-mingw32 when I run gem install Devise, and I'm required to uninstall Devise before I can uninstall bcrypt due to dependency issue. Why does not the same solution work with my setup?
@bodrovis thanks man :) your solution works for me (windows 7- x64)
(No issue on Linux but every time I moved to Windows, I'll get the error). gem uninstall bcrypt and gem install bcrypt --platform=ruby was a temporary fix, broke after bundle install.
gemfile.lock:
(Delete bcrypt from gemfile.lock)
Change devise to:
devise (4.4.3)
bcrypt (~> 3.0)
< scroll down to DEPENDENCIES >
DEPENDENCIES
bcrypt!
devise (~> 4.3)
Gemfile:
gem 'devise', '~> 4.3'
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
To commandline:
gem uninstall bcrypt
bundle install
@ohiodn8 Your solution is the only one that would work. I can now move forward with my project, thanks.
@ohiodn8 Works! Thanks!
You may have tried this already, but after install bcrypt you have to restart your server. Had the same issue you described, and nothing worked for me unless I restarted server after each install. Hope it helps.
^^^ yes we all know the workaround. we want the real issue to be fixed!
Despite using and following all the methods you all suggested, I am unable to use bcrypt successfully.
p.s.:I have installed and uninstalled bcrypt gem for almost a day and it still failed to work.
I have also been taking measures,for example, I restarted the server, changed the gem, install and uninstalled the gem and so on and so forth.This is indeed frustrating and unbelievable.I hope action would be taken with immediate effect.Thank you.
I have just pushed version 3.1.12.rc1 to RubyGems.org which should solve this problem.
Can someone please confirm that gem install bcrypt --prerelease now works on Windows? If so, I'll push out the final version.
Version 3.1.12 of the bcrypt gem, which should fix this issue, was just pushed to RubyGems.
You should now be able to gem install bcrypt on Windows with none of the above workarounds.
Thanks, everyone!
| Back | FazBrowse Home | New Git URL |
I recently created a new Rails project after installing Ruby and Rails on Windows with RailsInstaller. In my gemfile, I reference bcrypt like this:
gem 'bcrypt', '~> 3.1.7', platforms: :ruby (I added the platforms: :ruby, without server won't start with the same error as described further below)
The server can be started, no problems here, but wen instantiating a model with has_secure_password I get the following error message:
I tried fixing the version of bcrypt to 3.1.9, because I found this issue where a similar error occurred for the 3.1.7 and the solution was to use 3.1.9, but this didn't help at all, on the contrary: Afterwards the server wouldn't start at all.
I know there is Issue 142, but their solution doesn't work for me.
Does anyone have an idea how I could fix this?