Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jruby -S irb broken on solaris in 1.7.16 with JDK 7 #2040

Closed
mulvaney opened this Issue Oct 10, 2014 · 6 comments

Comments

Projects
None yet
4 participants
@mulvaney
Copy link

mulvaney commented Oct 10, 2014

jruby -S irb throws missing file errors in 1.7.16 using Java 7. It works ok with Java 8, and it worked fine in 1.7.15 with both Java 7 and Java8.

$ java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
$ jruby-1.7.16/bin/jruby -S irb
irb(main):001:0>

$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) Server VM (build 24.65-b04, mixed mode)
$ jruby-1.7.15/bin/jruby -S irb
irb(main):001:0>

But the same thing fails in 1.7.16:

$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) Server VM (build 24.65-b04, mixed mode)
$ jruby-1.7.16/bin/jruby -S irb
Errno::ENOENT: No such file or directory - /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/site_ruby/irb/lc/error.rb
        readable? at org/jruby/RubyFileTest.java:202
      search_file at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:148
             each at org/jruby/RubyArray.java:1613
      search_file at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:146
  each_localized_path at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:158
   each_sublocale at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:179
  each_localized_path at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:157
      search_file at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:145
             find at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:124
             load at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/locale.rb:108
       init_error at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/init.rb:122
            setup at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb/init.rb:17
            start at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/1.9/irb.rb:53
           (root) at /home/mm5830/jruby-download/jruby-1.7.16/bin/jirb:13
@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Oct 10, 2014

I have seen such an error before somewhere.

what LANG or LC_ALL or locale do have on that machine of yours ?

@mulvaney

This comment has been minimized.

Copy link
Author

mulvaney commented Oct 10, 2014

I don't have LANG or LC_ALL set. I should point out that I get this error a lot, about all kinds of different files. irb was just an easy way to show it. For example:

$ ./jruby-1.7.16/bin/jruby -S gem environment
Errno::ENOENT: No such file or directory - /home/mm5830/.gem/jruby/1.9
          file? at org/jruby/RubyFileTest.java:131
           dirs at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/shared/rubygems/defaults/jruby.rb:83
        collect at org/jruby/RubyArray.java:2407
           dirs at /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/shared/rubygems/defaults/jruby.rb:82

I don't have a ~/.gem/jruby/1.9 directory. I do have ~/.gem/jruby/1.9.3, though. RubyFileTest is checking to see if a file exists on line 131; it shouldn't be throwing a ENOENT if the file doesn't exist, it should be returning the empty file spec but apparently it is not.

If I change JAVA_HOME to point to Java 8, then I get:

$ ./jruby-1.7.16/bin/jruby -S gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.1.9
- RUBY VERSION: 1.9.3 (2014-09-25 patchlevel 392) [java]
- INSTALLATION DIRECTORY: /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/gems/shared
- RUBY EXECUTABLE: /home/mm5830/jruby-download/jruby-1.7.16/bin/jruby
- EXECUTABLE DIRECTORY: /home/mm5830/jruby-download/jruby-1.7.16/bin
- SPEC CACHE DIRECTORY: /home/mm5830/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.8
- GEM PATHS:
- /home/mm5830/jruby-download/jruby-1.7.16/lib/ruby/gems/shared
- /home/mm5830/.gem/jruby/1.9
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- :gem => "--no-ri --no-rdoc"
- :sources => ["http://rubygems.org/", "http://opns-devl.bna.com:9999/"]
- :benchmark => false
- REMOTE SOURCES:
- http://rubygems.org/
- SHELL PATH:
- /opt/bpub/java/java1.7/bin
- /usr/sfw/bin
- /opt/csw/bin
- /usr/bin
- /bin

My path still says java1.7 but I don't think that matters, jruby appears to care about JAVA_HOME but not which java is executable in the path.

@mislav

This comment has been minimized.

Copy link

mislav commented Oct 19, 2014

JRuby also breaks for me if I don't have the ~/.gem/jruby/1.9 directory (OS X 10.9.5):

$ gem list
Errno::ENOENT: No such file or directory - /Users/mislav/.gem/jruby/1.9
              file? at org/jruby/RubyFileTest.java:131
               dirs at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/defaults/jruby.rb:83
            collect at org/jruby/RubyArray.java:2407
               dirs at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/defaults/jruby.rb:82
              stubs at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:705
               _all at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:657
               each at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:855
       reverse_each at org/jruby/RubyEnumerable.java:1072
       latest_specs at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:971
  find_latest_files at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems.rb:490
       load_plugins at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems.rb:1006
             (root) at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/gem_runner.rb:81
            require at org/jruby/RubyKernel.java:1065
             (root) at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
            require at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
               load at org/jruby/RubyKernel.java:1081
             (root) at /opt/boxen/rbenv/versions/jruby-1.7.16/bin/gem:4

Creating the directory fixes Rubygems in JRuby.

@mislav

This comment has been minimized.

Copy link

mislav commented Oct 19, 2014

Related: #2032

@mkristian mkristian added this to the JRuby 1.7.17 milestone Dec 2, 2014

mkristian added a commit that referenced this issue Dec 2, 2014

fix File.readable? when native is disabled
this readable? method now follows the same pattern as writable?, file?,
directory? and exists? and uses the respective FileResource directly.

fixes #2040 and #1983

Sponsored by Lookout Inc.
@mkristian

This comment has been minimized.

@headius

This comment has been minimized.

Copy link
Member

headius commented Dec 2, 2014

I'm going to proactively resolve this. @mulvaney please let us know if it's not fixed on Solaris.

@headius headius closed this Dec 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.