0

看起来 jruby-1.7.16 在 SunOS 5.10 上无法正常工作。至少看起来不可能安装额外的宝石。

当我尝试运行 jgem 时,出现以下错误:

NoMethodError: undefined method `name' for nil:NilClass
           _resort! at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:717
              sort! at org/jruby/RubyArray.java:3358
           _resort! at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:716
               _all at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:665
               each at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:855
       reverse_each at org/jruby/RubyEnumerable.java:1072
       latest_specs at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:971
  find_latest_files at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems.rb:490
       load_plugins at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems.rb:1006
             (root) at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems/gem_runner.rb:81
            require at org/jruby/RubyKernel.java:1065
             (root) at /export/home/my_user/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
             (root) at ./jgem:9

我尝试在 Ubuntu LTS 12.04.4 上使用相同的发行版,它工作正常,可以安装 gems。

我在 Ubuntu 中安装了所需的 gem,打包了 jruby 并移至 SunOS 机器,但没有帮助。

jruby 是否完全支持 SunOS 5.1?jruby 和 irb 似乎运行良好,但 jgem 对我来说至关重要。

===== 编辑:这些是我在 jruby install 中找到的宝石

ls
axiom-types-0.1.1          equalizer-0.0.9            rake-10.1.0                ruby-maven-libs-3.1.1
coercible-1.0.0            ice_nine-0.11.0            rdoc-4.0.1                 thread_safe-0.3.4-java
descendants_tracker-0.0.4  maven-tools-1.0.5          ruby-maven-3.1.1.0.8       virtus-1.0.3

我在你提到的那行前面添加了 puts,对于 a.name 和 b.name,看起来在将 virtus 与 thread_safe 进行比较后发生了错误:

a = virtus
b= thread_safe
1
NoMethodError: undefined method `name' for nil:NilClass
4

1 回答 1

0

似乎某些 gem 规范没有名称(这看起来很奇怪):

def self._resort!(specs) # :nodoc:
  specs.sort! { |a, b|
    names = a.name <=> b.name # line 717
    next names if names.nonzero?
    b.version <=> a.version
  }
end

我会尝试在之前放置一个 putnames = a.name <=> b.name以了解发生了什么......如果它是一个干净的 JRuby 安装,那么绝对值得一个问题报告,但仍然值得深入研究,因为核心团队可能在 SunOS 机器上的水平很低:)

于 2014-10-02T17:56:08.813 回答