jruby bundle 安装在 gem 'scrypt' 时不工作
jruby bundle install not working at gem 'scrypt'
我正在尝试为 jruby (Windows) 执行捆绑安装,但出现此错误:
C:/jruby-1.7.19/bin/jruby.exe -rubygems C:/jruby-1.7.19/lib/ruby/gems/shared/gems/rake-10.1.0/bin/rake RUBYARCHDIR=C:/jruby-1.7.19/lib/ruby/gems/shared/extensions/universal-java-1.8/1.9/scrypt-2.0.2 RUBYLIBDIR=C:/jruby-1.7.19/lib/ruby/gems/shared/extensions/universal-java-1.8/1.9/scrypt-2.0.2
io/console not supported; tty will not be manipulated
mkdir -p i386-windows
cc -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -Wall -msse -msse2 -fPIC -o i386-windows/crypto_scrypt-sse.o -c ./crypto_scrypt-sse.c
rake aborted!
Command failed with status (127): [cc -fexceptions -O -fno-omit-frame-pointer...]
org/jruby/RubyProc.java:271:in `call'
org/jruby/RubyProc.java:271:in `call'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
Tasks: TOP => default => i386-windows/scrypt_ext.dll => i386-windows/crypto_scrypt-sse.o
(See full trace by running task with --trace)
rake failed, uncaught signal 1
我已经安装了 jruby 和 JVM。
您正在尝试在 java 版本的 ruby 中安装带有本机扩展的 gem:通常是个坏主意...
我在 https://github.com/wg/scrypt 找到了纯 java scrypt 算法的实现。
您需要从 Maven (http://search.maven.org/remotecontent?filepath=com/lambdaworks/scrypt/1.4.0/scrypt-1.4.0.jar) 下载 jar 文件,将其添加到您的库路径或在您的代码中 require jar。
下一步是编写一个包装器来模仿 scrypt 行为,将其用作 ruby/rails 代码中的直接替换。
或者,您可以只删除 scrypt 位并直接使用 java 库。这是在 jirb (1.7.20) 中测试的片段...
>> require 'java'
=> true
>> require './scrypt-1.4.0.jar'
=> true
>> java_import 'com.lambdaworks.crypto.SCryptUtil'
=> [Java::ComLambdaworksCrypto::SCryptUtil]
>> passwd,n,r,p = 'secret',16384,8,1
=> ["secret", 16384, 8, 1]
>> hashed_passwd = SCryptUtil.scrypt(passwd,n,r,p)
=> "$s0$e0801$MzcxaOBVz7kaVU6E5HV0cg==$RAx9ADWVeyZE5JRl+J1NpiBSEPNabEcVdR7drddpgMw="
>> SCryptUtil.check(passwd,hashed_passwd)
=> true
>> SCryptUtil.check('wrong password',hashed_passwd)
=> false
来晚了,我只是wrote a multi-platform gem which wraps up the details as an API drop-in replacement for the scrypt gem。
gem install scrypt-ruby -P MediumSecurity
我正在尝试为 jruby (Windows) 执行捆绑安装,但出现此错误:
C:/jruby-1.7.19/bin/jruby.exe -rubygems C:/jruby-1.7.19/lib/ruby/gems/shared/gems/rake-10.1.0/bin/rake RUBYARCHDIR=C:/jruby-1.7.19/lib/ruby/gems/shared/extensions/universal-java-1.8/1.9/scrypt-2.0.2 RUBYLIBDIR=C:/jruby-1.7.19/lib/ruby/gems/shared/extensions/universal-java-1.8/1.9/scrypt-2.0.2
io/console not supported; tty will not be manipulated
mkdir -p i386-windows
cc -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -Wall -msse -msse2 -fPIC -o i386-windows/crypto_scrypt-sse.o -c ./crypto_scrypt-sse.c
rake aborted!
Command failed with status (127): [cc -fexceptions -O -fno-omit-frame-pointer...]
org/jruby/RubyProc.java:271:in `call'
org/jruby/RubyProc.java:271:in `call'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
Tasks: TOP => default => i386-windows/scrypt_ext.dll => i386-windows/crypto_scrypt-sse.o
(See full trace by running task with --trace)
rake failed, uncaught signal 1
我已经安装了 jruby 和 JVM。
您正在尝试在 java 版本的 ruby 中安装带有本机扩展的 gem:通常是个坏主意...
我在 https://github.com/wg/scrypt 找到了纯 java scrypt 算法的实现。
您需要从 Maven (http://search.maven.org/remotecontent?filepath=com/lambdaworks/scrypt/1.4.0/scrypt-1.4.0.jar) 下载 jar 文件,将其添加到您的库路径或在您的代码中 require jar。
下一步是编写一个包装器来模仿 scrypt 行为,将其用作 ruby/rails 代码中的直接替换。
或者,您可以只删除 scrypt 位并直接使用 java 库。这是在 jirb (1.7.20) 中测试的片段...
>> require 'java'
=> true
>> require './scrypt-1.4.0.jar'
=> true
>> java_import 'com.lambdaworks.crypto.SCryptUtil'
=> [Java::ComLambdaworksCrypto::SCryptUtil]
>> passwd,n,r,p = 'secret',16384,8,1
=> ["secret", 16384, 8, 1]
>> hashed_passwd = SCryptUtil.scrypt(passwd,n,r,p)
=> "$s0$e0801$MzcxaOBVz7kaVU6E5HV0cg==$RAx9ADWVeyZE5JRl+J1NpiBSEPNabEcVdR7drddpgMw="
>> SCryptUtil.check(passwd,hashed_passwd)
=> true
>> SCryptUtil.check('wrong password',hashed_passwd)
=> false
来晚了,我只是wrote a multi-platform gem which wraps up the details as an API drop-in replacement for the scrypt gem。
gem install scrypt-ruby -P MediumSecurity