0

我被要求查看一些 Ruby 代码。开发人员运行 OSX,我在 Windows 上。在 OSX 上一切正常,但 Scrypt 2.1.1 出现错误。

Ruby 要求我运行:gem install scrypt -v '2.1.1'这会导致错误。当我这样做gem install scrypt -v '2.1.1' --platform=ruby时,情况正好相反,并且所有 gem 都已安装。

现在,当我重新创建 GemFile 或更新它时,我仍然收到错误,并且再次建议运行gem install scrypt -v '2.1.1'.

我得到的输出是:

Installing scrypt 2.1.1 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: <MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt
C:/Ruby23-x64/bin/ruby.exe -rubygems <MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake RUBYARCHDIR=<MyProject>/vendor/bundle/ruby/2.3.0/extensions/x64-mingw32/2.3.0/scrypt-2.1.1 RUBYLIBDIR=<MyProject>/vendor/bundle/ruby/2.3.0/extensions/x64-mingw32/2.3.0/scrypt-2.1.1
rake aborted!
LoadError: cannot load such file -- ffi_c
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:6:in `rescue in <top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:3:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-compiler-0.1.3/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt/Rakefile:1:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<main>'
LoadError: cannot load such file -- 2.3/ffi_c
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:4:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/ffi-compiler-0.1.3/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt/Rakefile:1:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<main>'
LoadError: cannot load such file -- ffi-compiler/compile_task
<MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1/ext/scrypt/Rakefile:1:in `<top (required)>'
<MyProject>/vendor/bundle/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<main>'
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in <MyProject>/vendor/bundle/ruby/2.3.0/gems/scrypt-2.1.1 for inspection.

我在 Google 和 Bing 上进行了查看和搜索,但没有找到解决方案。

希望社区中的某个人可以帮助我找到解决方案。

谢谢,伊万

4

1 回答 1

1
gem install ffi --platform=ruby
gem install scrypt -v 2.2.1

为我工作。

于 2016-07-01T18:45:25.067 回答