ruby on rails - jruby bundle install not working at gem 'scrypt' -
i trying bundle install jruby (windows) , getting error:
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 not 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 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 running task --trace) rake failed, uncaught signal 1
i have installed jruby , jvm.
you're trying install gem native extensions inside java version of ruby: bad idea...
i found pure java implementation of scrypt algorithm @ https://github.com/wg/scrypt.
you need download jar file maven (http://search.maven.org/remotecontent?filepath=com/lambdaworks/scrypt/1.4.0/scrypt-1.4.0.jar), add library path or require jar in code.
next write wrapper imitate scrypt behavior use drop-in replacement in ruby/rails code.
alternatively, remove scrypt bits , use java library directly. here's snippet tested in 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
Comments
Post a Comment