JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-5737

error: "Unsupported platform: unknown-darwin" when using JRuby's ffi and Java 1.7 macosx-port build

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.2
    • Fix Version/s: JRuby 1.6.4
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-25 ef0212b) (OpenJDK 64-Bit Server VM 1.7.0-internal) [darwin-universal-java]
    • Number of attachments :
      0

      Description

      I installed jruby head using rvm using the standard Java 1.6.0

      Then using a recent build of the macosx-port Java 1.7 build:

      http://www.concord.org/~sbannasch/macosx-port/java-1.7.0-internal-macosx-port-2011-04-25.tar.gz
      Expand and copy to ~/Library/Java/JavaVirtualMachines
      Open /Applications/Utilities/Java\ Preferences.app and move OpenJDK7 to the top of the list.

      Open a new shell.

      $ java -version
      openjdk version "1.7.0-internal"
      OpenJDK Runtime Environment (build 1.7.0-internal-stephen_2011_04_16_22_03-b00)
      OpenJDK 64-Bit Server VM (build 21.0-b07, mixed mode)
      
      $ ruby --version
      jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-25 ef0212b) (OpenJDK 64-Bit Server VM 1.7.0-internal) [darwin-universal-java]
      

      I then also installed rubygems 1.7.2 (but I don't think that matters):

      $ rvm use jruby-head
      Using /Users/stephen/.rvm/gems/jruby-head
      Running /Users/stephen/.rvm/hooks/after_use
      
      $ gem install rubygems-update
      Successfully installed rubygems-update-1.7.2
      1 gem installed
      [dev]$ update_rubygems 
      RubyGems 1.7.2 installed
      
      === 1.7.2 / 2011-04-05
      
      * 1 Bug Fix:
        * Warn on loading bad spec array values (ntlm-http gem has nil in its cert
          chain)
      
      
      ------------------------------------------------------------------------------
      
      RubyGems installed the following executables:
      	/Users/stephen/.rvm/rubies/jruby-head/bin/jgem
      

      Now install nokogiri and try and require it:

      $ gem install nokogiri
      Successfully installed nokogiri-1.4.4.2-java
      1 gem installed
      
      $ ruby -e "require 'rubygems'; require 'nokogiri'"
      LoadError: Unsupported platform: unknown-darwin
        require at org/jruby/RubyKernel.java:1038
        require at /Users/stephen/.rvm/rubies/jruby-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
         (root) at /Users/stephen/.rvm/rubies/jruby-head/lib/ruby/site_ruby/shared/ffi/ffi.rb:69
        require at org/jruby/RubyKernel.java:1038
        require at /Users/stephen/.rvm/rubies/jruby-head/lib/ruby/site_ruby/shared/ffi/ffi.rb:36
         (root) at /Users/stephen/.rvm/rubies/jruby-head/lib/ruby/site_ruby/shared/ffi.rb:1
        require at org/jruby/RubyKernel.java:1038
        require at /Users/stephen/.rvm/rubies/jruby-head/lib/ruby/site_ruby/shared/ffi.rb:36
         (root) at /Users/stephen/.rvm/gems/jruby-head@xproject/gems/nokogiri-1.4.4.2-java/lib/nokogiri.rb:10
        require at org/jruby/RubyKernel.java:1038
        require at /Users/stephen/.rvm/gems/jruby-head@xproject/gems/nokogiri-1.4.4.2-java/lib/nokogiri.rb:57
         (root) at -e:1
      

      $ gem install nokogiri

        Issue Links

          Activity

          Hide
          Hiro Asari added a comment -

          Stephen,

          Can you tell if http://code.google.com/p/openjdk-osx-build/downloads/detail?name=OpenJDK-OSX-1.7-universal-20110614.dmg has the fix? I suspect it does.

          Here's what I get:

          $ jruby -v -e "p ENV_JAVA['os.arch']"
          jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-06-18 cd8b796) (OpenJDK 64-Bit Server VM 1.7.0-internal) [darwin-x86_64-java]
          "x86_64"
          $ jruby -v -J-d32 -e "p ENV_JAVA['os.arch']"
          jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-06-18 cd8b796) (OpenJDK Server VM 1.7.0-internal) [darwin-i386-java]
          "i386"
          

          Thoughts?

          Show
          Hiro Asari added a comment - Stephen, Can you tell if http://code.google.com/p/openjdk-osx-build/downloads/detail?name=OpenJDK-OSX-1.7-universal-20110614.dmg has the fix? I suspect it does. Here's what I get: $ jruby -v -e "p ENV_JAVA['os.arch']" jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-06-18 cd8b796) (OpenJDK 64-Bit Server VM 1.7.0-internal) [darwin-x86_64-java] "x86_64" $ jruby -v -J-d32 -e "p ENV_JAVA['os.arch']" jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-06-18 cd8b796) (OpenJDK Server VM 1.7.0-internal) [darwin-i386-java] "i386" Thoughts?
          Hide
          Stephen Bannasch added a comment -

          Won't be able to check until tonight but looking at the results you got I'd say, yes it has the fix.

          Show
          Stephen Bannasch added a comment - Won't be able to check until tonight but looking at the results you got I'd say, yes it has the fix.
          Hide
          Wayne Meissner added a comment -

          btw, I pushed some changes into jffi a while ago to use the native lib to detect the cpu on macosx - if anyone wants to try that with jruby on JDK7, please do so - https://github.com/wmeissner/jffi

          It tries to be lazy about determining the CPU, so hopefully code that uses Platform, but does not interrogate the cpu type, won't load the stub lib.

          JRuby's Platform.java should be refactored to call down to jffi's version for system info.

          Show
          Wayne Meissner added a comment - btw, I pushed some changes into jffi a while ago to use the native lib to detect the cpu on macosx - if anyone wants to try that with jruby on JDK7, please do so - https://github.com/wmeissner/jffi It tries to be lazy about determining the CPU, so hopefully code that uses Platform, but does not interrogate the cpu type, won't load the stub lib. JRuby's Platform.java should be refactored to call down to jffi's version for system info.
          Hide
          Stephen Bannasch added a comment -

          I just tried jruby-head with a build today of macosx-port Java 1.7.0 and things seem to work.

          $ java -version
          openjdk version "1.7.0-internal"
          OpenJDK Runtime Environment (build 1.7.0-internal-stephen_2011_07_18_09_08-b00)
          OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
          
          $ jruby -v -e "p ENV_JAVA['os.arch']"
          jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-07-18 c1bb372) (OpenJDK 64-Bit Server VM 1.7.0-internal) [darwin-x86_64-java]
          "x86_64"
          
          $ jruby -v -J-d32 -e "p ENV_JAVA['os.arch']"
          jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-07-18 c1bb372) (OpenJDK Server VM 1.7.0-internal) [darwin-i386-java]
          "i386"
          

          I was also able to install and run nokogiri-1.5.0-java using jruby-head and the macosx-port of Java 1.7.0

          $ gem install nokogiri
          Fetching: nokogiri-1.5.0-java.gem (100%)
          Successfully installed nokogiri-1.5.0-java
          1 gem installed
          
          $ ruby -e "require 'rubygems'; require 'nokogiri'"
          

          I did not try wmeissner/jffi – couldn't find a readme or doc for how to use it.

          Show
          Stephen Bannasch added a comment - I just tried jruby-head with a build today of macosx-port Java 1.7.0 and things seem to work. $ java -version openjdk version "1.7.0-internal" OpenJDK Runtime Environment (build 1.7.0-internal-stephen_2011_07_18_09_08-b00) OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode) $ jruby -v -e "p ENV_JAVA['os.arch']" jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-07-18 c1bb372) (OpenJDK 64-Bit Server VM 1.7.0-internal) [darwin-x86_64-java] "x86_64" $ jruby -v -J-d32 -e "p ENV_JAVA['os.arch']" jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-07-18 c1bb372) (OpenJDK Server VM 1.7.0-internal) [darwin-i386-java] "i386" I was also able to install and run nokogiri-1.5.0-java using jruby-head and the macosx-port of Java 1.7.0 $ gem install nokogiri Fetching: nokogiri-1.5.0-java.gem (100%) Successfully installed nokogiri-1.5.0-java 1 gem installed $ ruby -e "require 'rubygems'; require 'nokogiri'" I did not try wmeissner/jffi – couldn't find a readme or doc for how to use it.
          Hide
          Hiro Asari added a comment -

          Does this need to be open? I believe it's fixed on master.

          Show
          Hiro Asari added a comment - Does this need to be open? I believe it's fixed on master.

            People

            • Assignee:
              Hiro Asari
              Reporter:
              Stephen Bannasch
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: