0

It looks that jruby-1.7.16 does not work correctly on SunOS 5.10. At least it looks like its impossible to install additional gems.

When I try to run jgem I get the following error:

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

I tried to use the same distribution on Ubuntu LTS 12.04.4 and it works correctly, gems could be installed.

I installed required gems in Ubuntu, packed jruby and moved to SunOS machine and it didn't help.

Is SunOS 5.1 fully supported by jruby? jruby and irb seem to run fine, but jgem is critical for me.

===== EDIT: These are gems that I found in 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

And I added puts in front of the line you mentioned and for a.name and b.name, it looks that error happened when after virtus was compared to thread_safe:

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

1 Answers1

0

seems that some of the gem specification does not have a name (which seems weird) :

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

I would try putting a puts before names = a.name <=> b.name to find out what's going on ... if it's a clean JRuby install than definitely worth an issue report, but still worth looking deeper since the core team might be low on SunOS machines :)

kares
  • 7,076
  • 1
  • 28
  • 38
  • I included details in the original question and yes it's clean jruby install. – m.kowalski Oct 03 '14 at 09:58
  • Found similar issue that was raised the same day I asked this question on stackoverflow: https://github.com/jruby/jruby/issues/2012 – m.kowalski Oct 03 '14 at 10:18
  • oh, I see - in that case there's an issue with the native stuff shipped in JRuby for Solaris ... it's likely caused by bundler/gem doing a `require 'openssl'` which triggers native FFI loading due Krypt (this will be eliminated in jruby-openssl **0.9.6**) – kares Oct 03 '14 at 10:57