web-dev-qa-db-ja.com

そのようなファイルをロードできません-1.9 / bcrypt_ext(LoadError)

Railsサーバーを起動しようとすると、次のエラーが発生します

何か案は?現時点では、可能な解決策は機能しませんでした...

ちなみに私はWindows8を実行しています...まったく問題かもしれません: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>'
15
Enno

今朝、私も同じ問題に直面しています(Windows7)。こちらをご覧になることをお勧めします https://github.com/codahale/bcrypt-Ruby/issues/72

私はこのように問題を正常に修正しました(Gemfileを更新します):

gem 'bcrypt-Ruby', '3.1.1.rc1', :require => 'bcrypt'
18
OpiOne

Gem bcryptに問題がある場合は、次の手順に従ってください。

1。bundle show bcrypt + ext\mri\で見つかったgemディレクトリに移動します。例:c:\RailsInstaller\Ruby2.2.3\lib\Ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri

2。実行Ruby extconf.rb

実行make

4。make install

これは、DevKit環境が正しくセットアップされている(devkitvars.batを実行する)場合にのみ機能することに注意してください。

4
erojas

同様の問題が発生しましたが、WindowsではRuby 2.0およびRails 3.2.15です。少なくとも3.1.2が必要です:

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

リンク: https://github.com/Rails/rails/pull/12325

2
fp4