Hello,
I have an existing ruby application and we are currently working to
integrate it into a java runtime.
We have thought of jruby.
I currently have to big issues :
1.no fork - I have went around this by using FFI :
module Exec
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function :my_exec, :execl, [:string, :string, :varargs], :int
attach_function :fork, [], :int
attach_function :getpid, [ ], :int
attach_function :kill,[:int,:int],:int
end
Is there a better solution for the Process.fork in ruby ?
- issue number 2 :
we have an old evironement and we can’t update it. also code has to be
run on solaris / intel 32 /64 bits architecture.
the current jruby we have and need is :
jgem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.9
- RUBY VERSION: 1.8.7 (2011-10-25 patchlevel 330) [java]
- INSTALLATION DIRECTORY: /home/local/jruby-1.6.5/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /local/jruby-1.6.5/bin/jruby
- EXECUTABLE DIRECTORY: /local/jruby-1.6.5/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
- GEM PATHS:
- /home/local/jruby-1.6.5/lib/ruby/gems/1.8
- /root/.gem/jruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- “install” => “–no-rdoc --no-ri --env-shebang”
- “update” => “–no-rdoc --no-ri --env-shebang”
- REMOTE SOURCES:
I have tried installing bitpack library however I get the following
error when trying to load the library /or any architecture related
library :
#jirb
irb(main):001:0> require
File.join(’/local/jruby-1.6.5/lib/ruby/gems/1.8/gems/’,‘bitpack-0.1/bitpack.so’)
LoadError: load error:
/local/jruby-1.6.5/lib/ruby/gems/1.8/gems/bitpack-0.1/bitpack –
java.lang.UnsatisfiedLinkError: failed to load shim library, error:
/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.14' not found (required by /local/jruby-1.6.5/lib/native/i386-Linux/libjruby-cext.so) from org/jruby/RubyKernel.java:1038:in
require’
from (irb):1:in evaluate' from org/jruby/RubyKernel.java:1088:in
eval’
from /local/jruby-1.6.5/lib/ruby/1.8/irb.rb:158:in eval_input' from /local/jruby-1.6.5/lib/ruby/1.8/irb.rb:271:in
signal_status’
from /local/jruby-1.6.5/lib/ruby/1.8/irb.rb:155:in eval_input' from org/jruby/RubyKernel.java:1420:in
loop’
from org/jruby/RubyKernel.java:1192:in catch' from /local/jruby-1.6.5/lib/ruby/1.8/irb.rb:154:in
eval_input’
from /local/jruby-1.6.5/lib/ruby/1.8/irb.rb:71:in start' from org/jruby/RubyKernel.java:1192:in
catch’
from /local/jruby-1.6.5/lib/ruby/1.8/irb.rb:70:in start' from /local/jruby-1.6.5/bin/jirb:13:in
(root)’
strings /usr/lib/libstdc++.so.6|grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBC_2.0
GLIBC_2.3
GLIBC_2.4
GLIBC_2.1
GLIBC_2.1.3
GLIBC_2.2
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH
strings /local/jruby-1.6.5/lib/native/i386-Linux/libjruby-cext.so|grep
GLIBC GLIBCXX_3.4.14
GLIBCXX_3.4
GLIBC_2.2.4
GLIBC_2.4
GLIBC_2.1
GLIBC_2.1.3
GLIBC_2.0
Is there a way to avoid this without system update which is not an
option ?