15

Hey I get the following Error when i try to start the rails server

Any ideas? At the moment no possible solution worked...

By the way I run Windows 8... might be the problem at all :D

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- 1.9/bcry
pt_ext (LoadError)
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw32/lib/bcrypt_ext.rb:2:in `<top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
    from C:/Users/Enno/RubymineProjects/BookWriting2.0/config/application.rb:13:in `<top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:24:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:24:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
2
  • I'm running on windows 7 also experiencing the same issue with "cannot load such file — 1.9/bcrypt_ext (LoadError)"
    – user648198
    Commented Jul 9, 2013 at 6:42
  • you might want to restart your local server after the changes mentioned above - that might save you some time.
    – joh-mue
    Commented Feb 17, 2015 at 21:26

6 Answers 6

18

This morning, I'm facing the same issue too (Windows 7). Let me recommend to have a look here https://github.com/codahale/bcrypt-ruby/issues/72

I successfully fix my problem like this (updating my Gemfile):

gem 'bcrypt-ruby', '3.1.1.rc1', :require => 'bcrypt'

2
  • FYI, the official bcrypt-ruby 3.1.1 have been released (including this fix)
    – OpiOne
    Commented Jul 11, 2013 at 13:37
  • The relevant version will constantly change. You can find the newest stable version number here: rubygems.org/gems/bcrypt-ruby
    – ogoldberg
    Commented Jun 2, 2014 at 15:49
4

If you have problems with the gem bcrypt, follow these steps:

1. Change to the gem directory found by bundle show bcrypt + ext\mri\, for example: c:\RailsInstaller\Ruby2.2.3\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri

2. run ruby extconf.rb

3. run make

4. make install

Note that this works only if your DevKit environment is correctly setup (run devkitvars.bat).

1
  • That was it. My DevKit path was not set, so bcrypt was not built. I had to add C:\DevKit2\bin;C:\DevKit2\mingw\bin to my path. These other answers are silly. Devise doesn't even depend on bcrypt-ruby. rubygems.org/gems/devise All they are doing is adding another gem which depends on bcrypt, and maybe it gets built this time, maybe not.
    – Chloe
    Commented Apr 13, 2017 at 0:51
2

I encountered a similar issue but with Ruby 2.0 and Rails 3.2.15 on Windows. It now requires at least 3.1.2:

gem 'bcrypt-ruby', '~> 3.1.2'

Link: https://github.com/rails/rails/pull/12325

0
-1

Comment off "gem 'bcrypt-ruby', '~> 3.0.0'" in your gemfile this should be work

-1

The relevant version will constantly change. You can find the newest stable version number here: rubygems.org/gems/bcrypt-ruby

-1

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]

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.