看起来jruby-1.7.16在SunOS 5.10上不能正常工作。至少看起来不可能安装额外的gem。
当我尝试运行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上使用相同的发行版,它工作正常,可以安装gem。
我在Ubuntu中安装了所需的gem,打包了jruby,并转移到SunOS机器上,但没有任何帮助。
JRuby5.1是否完全支持SunOS?jruby和irb似乎运行得很好,但jgem对我来说很关键。
jruby EDIT:这些是我在===== install中找到的gem
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发布于 2014-10-03 01:56:09
似乎一些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我会试着把一个out放在names = a.name <=> b.name之前,看看发生了什么.如果这是一个干净的JRuby安装,那么绝对值得一个问题报告,但仍然值得深入研究,因为核心团队可能在SunOS机器上很低:)
https://stackoverflow.com/questions/26100702
复制相似问题