FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support for ruby 2.2.1 on Windows · Issue #116 · bcrypt-ruby/bcrypt-ruby · GitHub

Repository navigation

Add support for ruby 2.2.1 on Windows #116

Description

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>'

Activity

  1. TaylorHuston commented on 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

  2. topac commented on Apr 17, 2015

    Author

    @TaylorHuston The dirty quick workaround is to install the mri version with gem install bcrypt --platform=ruby

  3. ccoenen commented on 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:

    C:\Users\user\workspace\project\> gem install bcrypt
    Fetching: bcrypt-3.1.10-x86-mingw32.gem (100%)
    Successfully installed bcrypt-3.1.10-x86-mingw32
    1 gem installed
    
    C:\Users\user\workspace\project\> irb
    irb(main):001:0> require 'bcrypt'
    LoadError: cannot load such file -- 2.2/bcrypt_ext
            from C:/Tools/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
            from C:/Tools/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
            from C:/Tools/Ruby22/lib/ruby/gems/2.2.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt_ext.rb:2:in `<top (required)>'
            from C:/Tools/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
            from C:/Tools/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
            from C:/Tools/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
            from C:/Tools/Ruby22/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10-x86-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
    
  4. gbisheimer commented on Sep 4, 2015

    Had the same problem and found the solution here.

  5. kalvakotasneha commented on Sep 10, 2015

    Yes this solution worked for me too.. Thanks @gbisheimer

  6. ccoenen commented on 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!

  7. alxmcr commented on Oct 18, 2015

    Hello everyone. Good afternoon.

    Is there any solution for: `require': cannot load such file -- bcrypt_ext (LoadError) ?

    Details:

    Name Version
    Ruby ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]
    Ruby on Rails Rails 4.2.4
    gem 2.4.8
    (Database) gem 'mysql2' '~> 0.3.18'
    (Server) gem 'puma ' '2.14.0'

    Note. I am using Dev Kit.
    I was trying the following, in Windows 7 (32-bit):

    1. 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>'
    
    1. 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
    

    Browser: http://localhost:3000/signup

    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.

  8. RemsonIO commented on Oct 19, 2015

    I have the same issues too with @ccoenen
    using

    gem 'bcrypt', '~> 3.1', '>= 3.1.10'
    

    load error shows on irb too
    But when I use

    gem 'bcrypt-ruby'
    

    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

    Makefile:34: *** multiple target patterns.  Stop.
    
  9. alxmcr commented on Oct 20, 2015

    Good evening. @RemsonIO , thanks for answering, then: Is there not a complete and definitive solution to the problem?

  10. ccoenen commented on 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.

  11. alxmcr commented on 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?

  12. gbisheimer commented on Oct 22, 2015

    I have just followed this commands:

    C:\> gem install --no-ri --no-rdoc bcrypt
    

    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
    

    That should be it.

    Remember you can always use google translate ;)

  13. alxmcr commented on Oct 22, 2015

    Hello @gbisheimer. Good afternoon.

    Details:

    Name Version
    Ruby ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]
    Ruby on Rails Rails 4.2.4
    gem 2.4.8
    DevKit 4.7.2-20130224

    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?_

  14. ccoenen commented on 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!

  15. alxmcr commented on Oct 23, 2015

    Hello everyone, Good afternoon.

    Details:

    Name Version
    Ruby ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]
    Ruby on Rails Rails 4.2.4
    gem 2.4.8
    DevKit 4.7.2

    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:

    • make.exe
    • libintl3.dll
    • libiconv2.dll

    In the folder:: C:\Ruby22\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri

    Please, 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.

  16. 14 remaining items

  17. jnslxndr commented on 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. 😞

  18. ccoenen commented on Jan 27, 2016

    Honestly, i have no idea. From my point of view, this gem seems unmaintained. :-(

  19. jnslxndr commented on 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

  20. howdoicomputer commented on 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.

  21. Nick-DeSimone commented on Feb 9, 2016

    @alxmcr solution above worked perfectly for me. Thanks!!

  22. cyerkovi commented on Feb 23, 2016

    Thanks for the solution @gbisheimer! It worked for me (Windows 10, Ruby 2.2.4, bcrypt 3.1.10)

  23. caleuanhopkins commented on 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-data gem to:
    gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

  24. pranayaryal commented on Mar 2, 2016

    That worked for me @caleuanhopkins thanks

  25. foxlance commented on Mar 2, 2016

    @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

  26. tjschuck commented on Mar 6, 2016

    Collaborator

    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 bcrypt on Windows with none of the above workarounds.

    Thanks!

  27. ccoenen commented on Mar 6, 2016

    confirmed with Windows 8.1 / Ruby 2.2.4 (32bit)

    Thanks!

  28. Nick-DeSimone commented on 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:

    • Windows 10
    • ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
    • Rails 4.2.5

    Thanks a ton!!

  29. jostster commented on 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 with bundle install I have to do gem uninstall bcrypt then gem install bcrypt --platform=ruby manually after running bundle install

  30. jostster commented on 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL