2016-06-13 66 views
0

我被要求查看一些Ruby代碼。開發人員運行OSX,我在Windows上。所有在OSX上工作正常,但我得到一個與Scrypt 2.1.1錯誤。Ruby Gem Scrypt 2.1.1不會在Windows上安裝

Ruby被要求運行:gem install scrypt -v '2.1.1'這會導致錯誤。 當我做gem install scrypt -v '2.1.1' --platform=ruby它完全相反,所有的寶石已安裝。

現在,當我重新創建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. 

我看了一下,搜查谷歌和Bing,但沒有所得溶液中。

希望有人在這裏的社區可以幫助我找到解決方案。

感謝, 伊萬

+0

你要麼沒有安裝devkit,要麼你的註冊表搞亂了。看看這裏的步驟:http://stackoverflow.com/a/21610123/1482694 – Sam

+0

devKit安裝和註冊表沒有搞亂,或至少在鏈接的文章中的所有檢查通過成功。 嘗試了32位安裝,因爲我正在使用64位安裝,並且有相同的問題。 – Iwan

+0

所以你已經嘗試了這裏列出的一切:https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#error-failed-to-build-gem-native-extension? – Sam

回答

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

爲我工作。