私はjrubyを使用するアプリケーションを持っていて、テーブルのファイルに関する情報を記録しています。ファイルサイズやメジャー/マイナーデバイス番号など)。 File::Stat.dev_minor
とFile::Stat.dev_major
これらの値はjrubyから戻ってきますか? (File :: Stat.dev_minor)
しかし、私はjrubyがRubyのネイティブパッケージruby 1.9.2とは非常に異なる値を生成していることに気づきました。 JRubyの1.6.4の下
irb(main):006:0> puts File::stat("/etc/passwd").dev_minor
5 <------- need to find this
=> nil
irb(main):007:0> puts File::stat("/etc/passwd").dev_major
104 <------- need to find this
=> nil
、これはしかし、そのも、このアプリはレコーディング、と私は今、ネイティブルビーに戻って変換する必要がありますされた数を返すされて、にClassNotFoundExceptionsを生成します。
# File.stat("/etc/passwd").dev_minor
java.lang.ClassNotFoundException: rubygems.defaults.OperatingSystemService
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Metho
Exception `LoadError' at file:/srv/logstash/logstash-monolithic-1.1.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/Win32API.rb:2 - Win32API only supported on win32
java.lang.ClassNotFoundException: rubygems.defaults.JrubyNativeService
at java.net.URLClassLoader$1.run(Unknown Source)
26629
# File.stat("/etc/passwd").dev_major
java.lang.ClassNotFoundException: rubygems.defaults.OperatingSystemService
at java.net.URLClassLoader$1.run(Unknown Source)
Exception `LoadError' at file:/srv/logstash/logstash-monolithic-1.1.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/Win32API.rb:2 - Win32API only supported on win32
java.lang.ClassNotFoundException: rubygems.defaults.JrubyNativeService
0 <------- and this one too...
私は、Fedora上の基本的なRubyの1.9.2からよりも太陽のJavaのホットスポットクライアント1.6.0_30を使用してのJRuby 1.6.4を使用しています。
提案がありますか?
私は
JRubyの..正常に戻っルビー形式にこれらの数字を変換したい - > File.stat( "/ etc/passwdファイル")dev_minorはstat -c %d /etc/passwd
= 26629