Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 无法在windows上加载这样的文件--bcrypt_ext(LoadError)_Ruby On Rails_Ruby - Fatal编程技术网

Ruby on rails 无法在windows上加载这样的文件--bcrypt_ext(LoadError)

Ruby on rails 无法在windows上加载这样的文件--bcrypt_ext(LoadError),ruby-on-rails,ruby,Ruby On Rails,Ruby,我有ruby 2.3.3p222(2016-11-21修订版56859)[x64-mingw32]和rails 5.1.4。当我运行rails s命令时,出现以下错误 rails s C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- bcrypt_ext (LoadError

我有ruby 2.3.3p222(2016-11-21修订版56859)[x64-mingw32]和rails 5.1.4。当我运行
rails s
命令时,出现以下错误

rails s
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- bcrypt_ext (LoadError)
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:12:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in `block (2 levels) in require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `each'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in `block in require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `each'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler.rb:114:in `require'
        from E:/Rauf Personal Data/work/rails/shine/config/application.rb:7:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in `block in perform'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `tap'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `perform'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'
rails
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active\u-support/dependencies.rb:292:“要求”中:无法加载此类文件--bcrypt\u-ext(LoadError)
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active\u-support/dependencies.rb:292:in'block in require'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active\u support/dependencies.rb:258:in'load\u dependency'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active\u support/dependencies.rb:292:in'require'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:16:in'rescue in'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x64-mingw32/lib/bcrypt.rb:12:in`'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:in'require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:83:在“请求中的块(2个级别)”中
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in'each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:78:in'block in require'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in'each'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler/runtime.rb:67:in'require'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.16.0.pre.2/lib/bundler.rb:114:in'require'
from E:/Rauf Personal Data/work/rails/shine/config/application.rb:7:in`'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in'require'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in'block in perform'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in'tap'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in'perform'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in'run'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in'invoke_命令'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in'dispatch'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in'perform'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in'invoke'
来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in`'
从箱子/轨道:4:in“require”
从箱子/轨道:4:in`'
我几乎尝试了所有的解决方案,但我无法解决这个问题。请任何人帮我解决这个问题。我已经试过了:

首先通过运行以下两个命令卸载bcrypt和bcrypt ruby: gem卸载bcrypt和gem卸载bcrypt ruby 使用gem Install bcrypt--platform=ruby再次安装它 在gem文件中,编写gem'bcrypt ruby','3.1.5',:require=>bcrypt'
运行bundle安装

我已通过在GEM文件中添加以下行来解决此问题

gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'

我通过在GEM文件中添加以下行来解决此问题

gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'

在尝试了几种方法后,上述方法对我有效: 1) 停止所有rails服务器。 2) 添加:gem'bcrypt',git:“”,:require=>'bcrypt'到gem文件。
3) 捆绑安装。

在尝试了几种方法后,上述方法对我有效: 1) 停止所有rails服务器。 2) 添加:gem'bcrypt',git:“”,:require=>'bcrypt'到gem文件。
3) 捆绑安装。

再次感谢。对于像我这样的初学者来说,你们是纯金的。再次感谢。对于像我这样的初学者来说,你们是纯金的。