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

NailGun and 1.9 seem not to be usable at the same time ( --1.9 and --ng)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.5
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Launcher
    • Environment:
      SunOS 5.10 Generic_139556-08 i86pc i386 i86pc
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      YAML is part of the Ruby 1.9 so,

      jruby --1.9 -e "require 'yaml'"
      

      succeeds.

      If the NailGun server is started,

      jruby --1.9 --ng-server &
      

      YAML can still be required if not using the NailGun client.

      jruby --1.9 -e "require 'yaml'"
      

      succeeds

      But it cannot be required if using the NailGun client.

      $ jruby --1.9 --ng -e "require 'yaml'"
      LoadError: no such file to load -- yaml
       require at org/jruby/RubyKernel.java:1038
         (root) at -e:1
      

      Either the client is not setting the correct mode, the server doesn't honor the version required by the client or by the NailGun start command, or NailGun somehow interferes with the loading of the 1.9 modules.

        Activity

        Hide
        Tnarik added a comment - - edited

        This patch solve the issue for me

        diff --git bin/jruby.bash bin/jruby.bash
        index 731f85e..edfe665 100644
        --- bin/jruby.bash
        +++ bin/jruby.bash
        @@ -343,7 +343,7 @@ fi
         
         if [ "$nailgun_client" != "" ]; then
           if [ -f $JRUBY_HOME/tool/nailgun/ng ]; then
        -    exec $JRUBY_HOME/tool/nailgun/ng org.jruby.util.NailMain "$@"
        +    exec $JRUBY_HOME/tool/nailgun/ng org.jruby.util.NailMain $mode "$@"
           else
             echo "error: ng executable not found; run 'make' in ${JRUBY_HOME}/tool/nailgun"
             exit 1
        

        The issue was that the $mode in the jruby.bash script was being lost when using the 'ng' command, and therefore the client was not using the 1.9 compatible mode.

        Show
        Tnarik added a comment - - edited This patch solve the issue for me diff --git bin/jruby.bash bin/jruby.bash index 731f85e..edfe665 100644 --- bin/jruby.bash +++ bin/jruby.bash @@ -343,7 +343,7 @@ fi if [ "$nailgun_client" != "" ]; then if [ -f $JRUBY_HOME/tool/nailgun/ng ]; then - exec $JRUBY_HOME/tool/nailgun/ng org.jruby.util.NailMain "$@" + exec $JRUBY_HOME/tool/nailgun/ng org.jruby.util.NailMain $mode "$@" else echo "error: ng executable not found; run 'make' in ${JRUBY_HOME}/tool/nailgun" exit 1 The issue was that the $mode in the jruby.bash script was being lost when using the 'ng' command, and therefore the client was not using the 1.9 compatible mode.
        Hide
        Tnarik added a comment -

        This is a patch for jruby.bash.

        Show
        Tnarik added a comment - This is a patch for jruby.bash.
        Hide
        Hiro Asari added a comment -

        Hi.

        Can we have a git-formatted patch, so that we can give you credit?

        Thanks.

        Show
        Hiro Asari added a comment - Hi. Can we have a git-formatted patch, so that we can give you credit? Thanks.
        Hide
        Hiro Asari added a comment -

        By the way, this problem does not exist with the native launcher. So please consider using jruby-launcher whenever possible.

        Show
        Hiro Asari added a comment - By the way, this problem does not exist with the native launcher. So please consider using jruby-launcher whenever possible.
        Hide
        Tnarik added a comment -

        GIT formatted patch

        Show
        Tnarik added a comment - GIT formatted patch
        Hide
        Nick Klauer added a comment -

        Does this fix JRUBY-6246? Is it pulled into master that I can test this on my machine (WinXP)?

        Show
        Nick Klauer added a comment - Does this fix JRUBY-6246 ? Is it pulled into master that I can test this on my machine (WinXP)?
        Hide
        Hiro Asari added a comment -

        I merged Tnarik's patch to master (1c3e9bd). A new nightly snapshot at ci.jruby.org/snapshots will have this tomorrow morning.

        Show
        Hiro Asari added a comment - I merged Tnarik's patch to master (1c3e9bd). A new nightly snapshot at ci.jruby.org/snapshots will have this tomorrow morning.
        Hide
        Keith R. Bennett added a comment -

        After trying out a few things, it looks like the problem is not with 1.9 mode per se, but that anything specified in JRUBY_OPTS or on the jruby command line messes up the way in which JRuby builds the command that starts up Nailgun.

        As a simple and significant test, I'd recommend specifying "--1.8" and seeing if the same problem will occur (I'm suggesting it will).

        In other words, I think the problem is related to specifying options, rather than the specification of any particular option. I believe this is relevant to the following issues:

        http://jira.codehaus.org/browse/JRUBY-6246
        http://jira.codehaus.org/browse/JRUBY-5611
        http://jira.codehaus.org/browse/JRUBY-6251

        I'm posting this comment in all three of the above.

        • Keith
        Show
        Keith R. Bennett added a comment - After trying out a few things, it looks like the problem is not with 1.9 mode per se, but that anything specified in JRUBY_OPTS or on the jruby command line messes up the way in which JRuby builds the command that starts up Nailgun. As a simple and significant test, I'd recommend specifying "--1.8" and seeing if the same problem will occur (I'm suggesting it will). In other words, I think the problem is related to specifying options, rather than the specification of any particular option. I believe this is relevant to the following issues: http://jira.codehaus.org/browse/JRUBY-6246 http://jira.codehaus.org/browse/JRUBY-5611 http://jira.codehaus.org/browse/JRUBY-6251 I'm posting this comment in all three of the above. Keith
        Hide
        Keith R. Bennett added a comment -

        Oops, I overlooked Hiro Asari's comment on http://jira.codehaus.org/browse/JRUBY-6246, which said that Nailgun could be run in 1.9 mode by using the following:

        jruby -Xcompat.version=1.9 --ng-server

        I guess there are some options that can be specified safely.

        Another comment of his said that the Nailgun's server version does not affect the version in which clients run, so it may not be important to set the version anyway.

        • Keith
        Show
        Keith R. Bennett added a comment - Oops, I overlooked Hiro Asari's comment on http://jira.codehaus.org/browse/JRUBY-6246 , which said that Nailgun could be run in 1.9 mode by using the following: jruby -Xcompat.version=1.9 --ng-server I guess there are some options that can be specified safely. Another comment of his said that the Nailgun's server version does not affect the version in which clients run, so it may not be important to set the version anyway. Keith

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Tnarik
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: