SixArm / sixarm_ruby_email_address_validation

SixArm.com » Ruby » Email address validation using RFC 822
http://sixarm.com
Other
10 stars 0 forks source link

RegexpError on Rubinius #2

Closed masterkain closed 12 years ago

masterkain commented 12 years ago

Hello, I'm using rbx-head:

An exception occurred running script/rails
    invalid multibyte escape: byte: 18: [^\x0d\x22\x5c\x80-\xff] (RegexpError)

Backtrace:
                                                Regexp#initialize at kernel/common/regexp.rb:97
  EmailAddressValidation.__module_init__ (EmailAddressValidation) at /Users/kain/.rvm/gems/rbx-head@myapp/gems/sixarm_ruby_email_address_validation-1.2.4/lib/sixarm_ruby_email_address_validation.rb:9
                                                Object#__script__ at /Users/kain/.rvm/gems/rbx-head@myapp/gems/sixarm_ruby_email_address_validation-1.2.4/lib/sixarm_ruby_email_address_validation.rb:7
                                     Rubinius::CodeLoader.require at kernel/common/codeloader.rb:207
                                                   Kernel.require at kernel/common/kernel.rb:631
                                  { } in Bundler::Runtime#require at /Users/kain/.rvm/gems/rbx-head@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68
                                                       Array#each at kernel/bootstrap/array.rb:68
                                  { } in Bundler::Runtime#require at /Users/kain/.rvm/gems/rbx-head@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66
                                                       Array#each at kernel/bootstrap/array.rb:68
                                         Bundler::Runtime#require at /Users/kain/.rvm/gems/rbx-head@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55
                                                  Bundler.require at /Users/kain/.rvm/gems/rbx-head@global/gems/bundler-1.1.3/lib/bundler.rb:119
                                                Object#__script__ at config/application.rb:13
                                     Rubinius::CodeLoader.require at kernel/common/codeloader.rb:207
                                           Kernel(Object)#require at kernel/common/kernel.rb:631
                                         { } in Object#__script__ at /Users/kain/.rvm/gems/rbx-head@myapp/gems/railties-3.2.3/lib/rails/commands.rb:53
                                        Kernel(Rails::Server)#tap at kernel/common/kernel.rb:241
                                                Object#__script__ at /Users/kain/.rvm/gems/rbx-head@myapp/gems/railties-3.2.3/lib/rails/commands.rb:50
                                     Rubinius::CodeLoader.require at kernel/common/codeloader.rb:207
                                           Kernel(Object)#require at kernel/common/kernel.rb:631
                                                Object#__script__ at script/rails:6
                                 Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67
                                 Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:109
                                          Rubinius::Loader#script at kernel/loader.rb:632
                                            Rubinius::Loader#main at kernel/loader.rb:836
SixArm commented 12 years ago

Thanks for the report. Do you see the same error on the release version of Rubinius 1.2.4? -Joel

SixArm commented 12 years ago

I created a new version of the gem for you. Try this: "gem update sixarm_ruby_email_address_validation". This will download version 2.0.0. Try it in RBX head. If it works, great. If it doesn't work, can you show me what code you're using that's triggering the error? Thanks, Joel

masterkain commented 12 years ago

Hi Joel, I just tried but I have the same error:

E, [2012-04-17T17:32:38.900486 #77931] ERROR -- : invalid multibyte escape: byte: 18: [^\x0d\x22\x5c\x80-\xff] (RegexpError)
kernel/common/regexp.rb:97:in `initialize'
/Users/kain/.rvm/gems/rbx-head@myapp/gems/sixarm_ruby_email_address_validation-2.0.0/lib/sixarm_ruby_email_address_validation.rb:9:in `__class_init__ (EmailAddressValidation)'
/Users/kain/.rvm/gems/rbx-head@myapp/gems/sixarm_ruby_email_address_validation-2.0.0/lib/sixarm_ruby_email_address_validation.rb:7:in `__script__'

I'm afraid I can't try rbx stable right now, perhaps I'll have more time during the day.

Thanks!

masterkain commented 12 years ago

I'm not entirely sure what's going on here, but it may be a Rubinius issue.

Regexp.new '[^\\x0d\\x22\\x5c\\x80-\\xff]', nil, 'n' raises, /cc @dbussink

rubinius-2.0.0dev :001 > Regexp.new '[^\\x0d\\x22\\x5c\\x80-\\xff]', nil, 'n'
RegexpError: invalid multibyte escape: byte: 18: [^\x0d\x22\x5c\x80-\xff]
    from kernel/common/regexp.rb:97:in `initialize'
    from (irb):1
    from kernel/common/block_environment.rb:75:in `call_on_instance'
    from kernel/common/eval.rb:72:in `eval'
    from kernel/common/kernel19.rb:44:in `loop'
    from kernel/common/throw_catch19.rb:8:in `catch'
    from kernel/common/throw_catch.rb:10:in `register'
    from kernel/common/throw_catch19.rb:7:in `catch'
    from kernel/common/throw_catch19.rb:8:in `catch'
    from kernel/common/throw_catch.rb:10:in `register'
    from kernel/common/throw_catch19.rb:7:in `catch'
    from kernel/delta/codeloader.rb:67:in `load_script'
    from kernel/delta/codeloader.rb:109:in `load_script'
    from kernel/loader.rb:632:in `script'
    from kernel/loader.rb:836:in `main'
dbussink commented 12 years ago

Could you open an issue with Rubinius with this specific issue? That repro with a single statement is great! It looks like it's only happening in 1.9 mode and not 1.8 mode.

masterkain commented 12 years ago

This appears to be fixed in rbx-head, thanks!

SixArm commented 12 years ago

Good, thanks for the update. Glad it works for you now.