You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, bcrypt does not work on ruby 2.2.1p85 (2015-02-26 revision 49769) [i386-mingw32] (windows server 2008)
C:\test\test-db>gem install bcrypt
Successfully installed bcrypt-3.1.10-x86-mingw32
Parsing documentation for bcrypt-3.1.10-x86-mingw32
Done installing documentation for bcrypt after 0 seconds
1 gem installed
C:\test\test-db>irb
irb(main):001:0> require 'bcrypt'
LoadError: cannot load such file -- bcrypt_ext
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x86-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from (irb):1
from C:/Ruby/bin/irb:11:in `<main>'
my japanese is somewhat rusty, and external links tend to disappear over the years. @gbisheimer or @kalvakotasneha would you care to add the workaround in here (in english, if possible)? Thanks in advance!
Note. I am using Dev Kit.
I was trying the following, in Windows 7 (32-bit):
gem 'bcrypt'
Error output terminal:
$ rails s
C:/Ruby22/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x86-mingw32/lib/bcrypt.rb:16:in `require': cannot load such file -- bcrypt_ext (LoadError)
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x86-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from E:/Mis Documentos/Alejandro/MyRepos_Github/miautenticacion/config/application.rb:7:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
gem 'bcrypt-ruby', '3.1.1.rc1'
Error output terminal:
$ rails s
=> Booting Puma
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Puma 2.14.0 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://localhost:3000
The specified module could not be found. C:/Ruby22/lib/ruby/gems/2.2.0/gems/bcrypt-ruby-3.1.1.rc1-x86-mingw32/lib/bcrypt_ext.so
Error output terminal:
$ rails s
=> Booting Puma
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Puma 2.14.0 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://localhost:3000
Started GET "/" for ::1 at 2015-10-18 00:11:16 -0400
ActiveRecord::SchemaMigration Load (0.0ms) SELECT `schema_migrations`.* FROM `schema_migrations`
Processing by Rails::WelcomeController#index as HTML
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/templates/rails/welcome/index.html.erb (3.0ms)
Completed 200 OK in 58ms (Views: 43.9ms | ActiveRecord: 0.0ms)
Started GET "/signup" for ::1 at 2015-10-18 00:11:21 -0400
Processing by UsersController#new as HTML
You don't have bcrypt installed in your application. Please add it to your Gemfile and run bundle install
Completed 500 Internal Server Error in 20ms (ActiveRecord: 0.0ms)
LoadError (126: No se puede encontrar el módulo especificado. - C:/Ruby22/lib/ruby/gems/2.2.0/gems/bcrypt-ruby-3.1.1.rc1-x86-mingw32/lib/bcrypt_ext.so):
app/models/user.rb:2:in `<class:User>'
app/models/user.rb:1:in `<top (required)>'
app/controllers/users_controller.rb:3:in `new'
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (1.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (728.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_markup.html.erb (0.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/console.js.erb within layouts/javascript (670.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/main.js.erb within layouts/javascript (1.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/error_page.js.erb within layouts/javascript (1.0ms)
Rendered C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/templates/index.html.erb (1541.1ms)
Please, I would appreciate help me solve this problem.
@gbisheimer apparently posted a solution, but it is (quite literally) japanese to me. If someone's japanese (or ruby) is good enough I'd appreciate a translation.
This installs the gem in the local gem repository. Then you need to build some things.
C:\> cd (path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> ruby extconf.rb
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make install
Note. I am using Dev Kit.
I was trying the following, in Windows 7 (32-bit):
_(bcrypt-3.1.7-x86-mingw32) Run the command 'ruby extconf.rb' :_
C:\Ruby22\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.7-x86-mingw32\ext\mri
$ ruby extconf.rb
checking for ruby/util.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby22/bin/$(RUBY_BASE_NAME)
C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
from extconf.rb:14:in `<main>'
(bcrypt-3.1.10-x86-mingw32) Run the command 'make' :
C:\Ruby22\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri> make
He gave me the following error:
make: *** No rule to make target/C/Ruby22/include/ruby-2.2.0/ruby.h', needed by bcrypt_ext.o'. High.
_Do you know any reason for the error? Please. Can I help you solve the problem?_
@gbisheimer I wonder why it installed bcrypt 3.1.7 on your machine when 3.1.10 is the up to date version. Still: i have taken the steps you translated (THANKS!) and tried them on my machine on the 3.1.10 gem.
I can confirm that these steps work on a Windows 7 machine with Ruby 2.2.2p95 (32bit) from RubyInstaller and after loading the RubyDevKit-4.7.2-32bit.
I can also confirm that the steps work with Ruby 2.2.2p95 (64bit) with the 64bit DevKit.
@ccoenen i can confirm, that the steps are working.
how can we resolve this? i am using windows only as a build system and would love to get arround a batch file, that does this. 😞
Since I didn't know how long it would take for a fix to come out, I documented how to solve this problem in the development environment guide for a project that I have started contributing to.
Could be a reference point for anyone stumbling on this thread.
If anyone is still having issues with this (especially with devise) on Windows 64 bit, try installing Ruby 64 bit, then rails as a gem (rather than using the rails installer) and then add: gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt"
You may need to change your tzinfo-data gem to: gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
@gbisheimer suggestion worked for me but I couldn't make the devkitvars work. @RemsonIO was very helpful! This fixes the issue on my Win7 64bit + railsinstaller-3.2.0
@tjschuck this still doesn't seem to work with 3.1.11 for 64 bit. I have gem 'bcrypt', platforms: [:ruby] in my Gem file and it doesn't install the x64 bit with bundle install I have to do gem uninstall bcrypt then gem install bcrypt --platform=ruby manually after running bundle install
Activity
TaylorHuston commentedon Apr 17, 2015
I'm having the same issue.
Win7 x64
ruby 2.2.1p85 (2015-02-26 revision 49769) [i386-mingw32]
Running the same app from OSX works fine using ruby 2.2.0p0
topac commentedon Apr 17, 2015
@TaylorHuston The dirty quick workaround is to install the mri version with
gem install bcrypt --platform=rubyccoenen commentedon Jul 1, 2015
very same thing here with bcrypt 3.1.10 on ruby 2.2.2 (more specifically Windows 8.1 64bit, ruby 2.2.2p95 32bit from rubyinstaller, Devkit loaded).
The error can be reproduced in irb without rails:
gbisheimer commentedon Sep 4, 2015
Had the same problem and found the solution here.
kalvakotasneha commentedon Sep 10, 2015
Yes this solution worked for me too.. Thanks @gbisheimer
ccoenen commentedon Sep 10, 2015
my japanese is somewhat rusty, and external links tend to disappear over the years. @gbisheimer or @kalvakotasneha would you care to add the workaround in here (in english, if possible)? Thanks in advance!
alxmcr commentedon Oct 18, 2015
Hello everyone. Good afternoon.
Is there any solution for: `require': cannot load such file -- bcrypt_ext (LoadError) ?
Details:
Note. I am using Dev Kit.
I was trying the following, in Windows 7 (32-bit):
gem 'bcrypt'Error output terminal:
gem 'bcrypt-ruby', '3.1.1.rc1'Error output terminal:
Browser: http://localhost:3000/signup
Error output terminal:
Please, I would appreciate help me solve this problem.
RemsonIO commentedon Oct 19, 2015
I have the same issues too with @ccoenen
using
load error shows on irb too
But when I use
it loads normally while the error appears again once i started the /login page
i tried doing the one with make command but it shows me this error
alxmcr commentedon Oct 20, 2015
Good evening. @RemsonIO , thanks for answering, then: Is there not a complete and definitive solution to the problem?
ccoenen commentedon Oct 20, 2015
@gbisheimer apparently posted a solution, but it is (quite literally) japanese to me. If someone's japanese (or ruby) is good enough I'd appreciate a translation.
alxmcr commentedon Oct 22, 2015
Hello @gbisheimer, please, can you help me? How I can do to me that Windows recognizes the make command? What steps did you follow to achieve?
gbisheimer commentedon Oct 22, 2015
I have just followed this commands:
This installs the gem in the local gem repository. Then you need to build some things.
That should be it.
Remember you can always use google translate ;)
alxmcr commentedon Oct 22, 2015
Hello @gbisheimer. Good afternoon.
Details:
Note. I am using Dev Kit.
I was trying the following, in Windows 7 (32-bit):
_(bcrypt-3.1.7-x86-mingw32) Run the command 'ruby extconf.rb' :_
(bcrypt-3.1.10-x86-mingw32) Run the command 'make' :
C:\Ruby22\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri> makeHe gave me the following error:
make: *** No rule to make target/C/Ruby22/include/ruby-2.2.0/ruby.h', needed bybcrypt_ext.o'. High._Do you know any reason for the error? Please. Can I help you solve the problem?_
ccoenen commentedon Oct 22, 2015
@gbisheimer I wonder why it installed bcrypt 3.1.7 on your machine when 3.1.10 is the up to date version. Still: i have taken the steps you translated (THANKS!) and tried them on my machine on the 3.1.10 gem.
I can confirm that these steps work on a Windows 7 machine with Ruby 2.2.2p95 (32bit) from RubyInstaller and after loading the RubyDevKit-4.7.2-32bit.
I can also confirm that the steps work with Ruby 2.2.2p95 (64bit) with the 64bit DevKit.
Thank you!
alxmcr commentedon Oct 23, 2015
Hello everyone, Good afternoon.
Details:
Note. I am using Dev Kit.
I was trying the following, in Windows 7 (32-bit):
I followed the steps indicated by @gbisheimer and @ccoenen , but I get the following result:
The complete file ruby.h are here: ruby.h
Note.- To use the make command in Windows, I followed these steps:
1.- Download Make for Windows - Complete package, except sources
2.- Copy the following files:
In the folder::
C:\Ruby22\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mriPlease, Can you help me ?, Could have done something wrong with using the MAKE command?
Is there another way to set the "make" command in Windows?
Sorry, I have no experience with the 'make' command.
14 remaining items
jnslxndr commentedon Jan 26, 2016
@ccoenen i can confirm, that the steps are working.
how can we resolve this? i am using windows only as a build system and would love to get arround a batch file, that does this. 😞
ccoenen commentedon Jan 27, 2016
Honestly, i have no idea. From my point of view, this gem seems unmaintained. :-(
jnslxndr commentedon Jan 28, 2016
@codahale any pointer on how we can support a fix? I've never done a gem though.
@ccoenen here is my rake task: https://gist.github.com/anonymous/c193784e4de8781551d5
howdoicomputer commentedon Feb 4, 2016
Since I didn't know how long it would take for a fix to come out, I documented how to solve this problem in the development environment guide for a project that I have started contributing to.
Could be a reference point for anyone stumbling on this thread.
Nick-DeSimone commentedon Feb 9, 2016
@alxmcr solution above worked perfectly for me. Thanks!!
cyerkovi commentedon Feb 23, 2016
Thanks for the solution @gbisheimer! It worked for me (Windows 10, Ruby 2.2.4, bcrypt 3.1.10)
caleuanhopkins commentedon Feb 29, 2016
If anyone is still having issues with this (especially with devise) on Windows 64 bit, try installing Ruby 64 bit, then rails as a gem (rather than using the rails installer) and then add:
gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt"You may need to change your
tzinfo-datagem to:gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]pranayaryal commentedon Mar 2, 2016
That worked for me @caleuanhopkins thanks
foxlance commentedon Mar 2, 2016
@gbisheimer suggestion worked for me but I couldn't make the
devkitvarswork. @RemsonIO was very helpful! This fixes the issue on my Win7 64bit + railsinstaller-3.2.0tjschuck commentedon Mar 6, 2016
Version 3.1.11 of the bcrypt gem was just pushed to RubyGems which should fix this issue.
You should now be able to
gem install bcrypton Windows with none of the above workarounds.Thanks!
ccoenen commentedon Mar 6, 2016
confirmed with Windows 8.1 / Ruby 2.2.4 (32bit)
Thanks!
Nick-DeSimone commentedon Mar 8, 2016
I had successfully worked around this, but Iike leaving things clean for the person after me in this app.
I uninstalled brypt 3.1.10 (with the workaround), adjusted my Gemfile.lock, and ran "bundle install"
It worked perfect on:
Thanks a ton!!
jostster commentedon Nov 4, 2016
@tjschuck this still doesn't seem to work with 3.1.11 for 64 bit. I have
gem 'bcrypt', platforms: [:ruby]in my Gem file and it doesn't install the x64 bit withbundle installI have to dogem uninstall bcryptthengem install bcrypt --platform=rubymanually after runningbundle installjostster commentedon Nov 4, 2016
Looks like the exact issue is also #139. There was a PR to have a more perm fix but it seems to have not been accepted.