`': invalid multibyte character (ArgumentError) in TMail/Utils

    今天用Tmail时, 遇到了异常如下:

C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail/utils.rb:117:in `<module:TextUtils>': invalid multibyte character (ArgumentError)
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail/utils.rb:110:in `<module:TMail>'
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail/utils.rb:53:in `<top (required)>'
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail/interface.rb:36:in `require'
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail/interface.rb:36:in `<top (required)>'
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail/mail.rb:34:in `require'
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail/mail.rb:34:in `<top (required)>'
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail.rb:2:in `require'
        from C:/ruby-1.9.1-p129-i386-mswin32/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/lib/tmail.rb:2:in `<top (required)>'
        from E:/Development/MailOnRails/app/models/new_main.rb:1:in `require'
        from E:/Development/MailOnRails/app/models/new_main.rb:1:in `<main>'

 

这是NetBeans7.0以前的一个Bug, 可以参见NetBean事件158794.

解决方法:

setting the 'ruby.no.kcode' system variable

e.g. by adding -J-Druby.no.kcode=true to netbeans_default_options in <netbeans install directory>/etct/netbeans.conf

你可能感兴趣的:(C++,c,C#,Ruby,Netbeans)