Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.5.6
    • Fix Version/s: JRuby 1.6RC1
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      MBP running snow leopard (java 1.6.0_22
    • Number of attachments :
      0

      Description

      After update from 1.5.5 to 1.5.6, a rails3 app using devise & mongoid to managing & persist users respectively I began seeing errors indicating a NameError and the inability to load class "crypt_jruby.BCrypt". I have since reverted back to jruby 1.5.5 so I cannot provide the exact message.

        Activity

        Hide
        david steele added a comment -

        My mistake, the error is actually the inability to load "bcrypt_jruby.BCrypt"

        Show
        david steele added a comment - My mistake, the error is actually the inability to load "bcrypt_jruby.BCrypt"
        Hide
        Georg Mittendorfer added a comment -

        Same issue here on linux centos 5.5 with sun jdk1.6.0_23 and jruby-1.5.6 and bcrypt-ruby (2.1.2). Fresh install. Example error message (executing my testcases) is:

        NameError: cannot load Java class bcrypt_jruby.BCrypt
        /test/functional/sessions_controller_test.rb:7:in `_callback_before_385'

        Show
        Georg Mittendorfer added a comment - Same issue here on linux centos 5.5 with sun jdk1.6.0_23 and jruby-1.5.6 and bcrypt-ruby (2.1.2). Fresh install. Example error message (executing my testcases) is: NameError: cannot load Java class bcrypt_jruby.BCrypt /test/functional/sessions_controller_test.rb:7:in `_callback_before_385'
        Hide
        Jeff Wang added a comment -

        I have the same problem on my MBP. jruby 1.5.6, java 1.6.0_22. I'm running devise 1.1.3.

        Show
        Jeff Wang added a comment - I have the same problem on my MBP. jruby 1.5.6, java 1.6.0_22. I'm running devise 1.1.3.
        Hide
        Hiroshi Nakamura added a comment -
        0% ls
        class/  load.rb
        0% ls -lR
        .:
        total 8
        drwxrwxr-x 3 nahi nahi 4096 2010-12-12 09:59 class/
        -rw-rw-r-- 1 nahi nahi   52 2010-12-12 09:58 load.rb
        
        ./class:
        total 12
        -rw-rw-r-- 1 nahi nahi  180 2010-12-12 09:59 Foo.class
        -rw-rw-r-- 1 nahi nahi   20 2010-12-12 09:59 Foo.java
        drwxrwxr-x 2 nahi nahi 4096 2010-12-12 09:55 tmp/
        
        ./class/tmp:
        total 8
        -rw-rw-r-- 1 nahi nahi 184 2010-12-12 09:55 Foo.class
        -rw-rw-r-- 1 nahi nahi  33 2010-12-12 09:55 Foo.java
        0% /home/nahi/java/jruby-1.5.6/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.tmp.Foo'
        /home/nahi/java/jruby-1.5.6/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in `method_missing': cannot load Java class tmp.Foo (NameError)
        	from -e:1
        1% /home/nahi/java/jruby-1.5.6/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.Foo'    
        Java::Foo
        0% /home/nahi/java/jruby-1.5.5/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.tmp.Foo'
        Java::Tmp::Foo
        0% /home/nahi/java/jruby-1.5.5/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.Foo'    
        Java::Default::Foo
        0% 
        

        The failure seems to be from this commit.

        commit 2831f2d310082d403c000a8faadcbf4881954631
        Author: Nick Sieger <nick@nicksieger.com>
        Date:   Thu Dec 2 15:08:58 2010 -0600
        
            JRUBY-4774, WARBLER-15: Fix classpath and load path issues related to file paths containing spaces
        
        Show
        Hiroshi Nakamura added a comment - 0% ls class/ load.rb 0% ls -lR .: total 8 drwxrwxr-x 3 nahi nahi 4096 2010-12-12 09:59 class/ -rw-rw-r-- 1 nahi nahi 52 2010-12-12 09:58 load.rb ./class: total 12 -rw-rw-r-- 1 nahi nahi 180 2010-12-12 09:59 Foo.class -rw-rw-r-- 1 nahi nahi 20 2010-12-12 09:59 Foo.java drwxrwxr-x 2 nahi nahi 4096 2010-12-12 09:55 tmp/ ./class/tmp: total 8 -rw-rw-r-- 1 nahi nahi 184 2010-12-12 09:55 Foo.class -rw-rw-r-- 1 nahi nahi 33 2010-12-12 09:55 Foo.java 0% /home/nahi/java/jruby-1.5.6/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.tmp.Foo' /home/nahi/java/jruby-1.5.6/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in `method_missing': cannot load Java class tmp.Foo (NameError) from -e:1 1% /home/nahi/java/jruby-1.5.6/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.Foo' Java::Foo 0% /home/nahi/java/jruby-1.5.5/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.tmp.Foo' Java::Tmp::Foo 0% /home/nahi/java/jruby-1.5.5/bin/jruby -rjava -e '$CLASSPATH << "class"; p Java.Foo' Java::Default::Foo 0% The failure seems to be from this commit. commit 2831f2d310082d403c000a8faadcbf4881954631 Author: Nick Sieger <nick@nicksieger.com> Date: Thu Dec 2 15:08:58 2010 -0600 JRUBY-4774, WARBLER-15: Fix classpath and load path issues related to file paths containing spaces
        Hide
        Hiroshi Nakamura added a comment -

        Ugly workaround:

        require "bcrypt"
        $CLASSPATH.each do |path|
          $CLASSPATH << path.sub(/^file:/, "") + "/" if path.index("bcrypt-ruby")
        end
        
        Show
        Hiroshi Nakamura added a comment - Ugly workaround: require "bcrypt" $CLASSPATH.each do |path| $CLASSPATH << path.sub(/^file:/, "") + "/" if path.index("bcrypt-ruby") end
        Hide
        Hiroshi Nakamura added a comment -

        Nick Sieger already fixed it on master.
        https://github.com/jruby/jruby/commit/621bce3056f71cc9cd0e1b8aa59cecae1fc15e45
        The patch applies 1.5.6 cleanly: https://gist.github.com/738593

        Show
        Hiroshi Nakamura added a comment - Nick Sieger already fixed it on master. https://github.com/jruby/jruby/commit/621bce3056f71cc9cd0e1b8aa59cecae1fc15e45 The patch applies 1.5.6 cleanly: https://gist.github.com/738593
        Hide
        Hiro Asari added a comment -

        Cherry-picked the commit to the 1.5 branch. 8740a6b

        Show
        Hiro Asari added a comment - Cherry-picked the commit to the 1.5 branch. 8740a6b
        Hide
        Hiroshi Nakamura added a comment -

        No need to wait 1.5.7. Update bcrypt-ruby gem!
        "bcrypt-ruby no longer modifies $CLASSPATH and instead require()s a .jar file"
        http://twitter.com/#!/tmm1/status/17065801324437504
        Thank you, @tmm1.

        Show
        Hiroshi Nakamura added a comment - No need to wait 1.5.7. Update bcrypt-ruby gem! "bcrypt-ruby no longer modifies $CLASSPATH and instead require()s a .jar file" http://twitter.com/#!/tmm1/status/17065801324437504 Thank you, @tmm1.

          People

          • Assignee:
            Nick Sieger
            Reporter:
            david steele
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: