Tuesday, January 12, 2010

ActionMailer invalid multibyte character error while starting WEBrick server

If you are using Netbeans for your Rails application development and you are using ruby 1.9, then when you want to run the WEBrick server you may get this error:

C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionmailer-2.3.5/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb:117:in '': invalid multibyte character (ArgumentError)

Well this is not happening for your rails installation rather for a bug that exists in netbeans. The workaround is simple. You just have to add and set the variable J-Druby.no.kcode to true in your {Netbeans installation dir}/etc/netbeans.conf file just like this:

netbeans_default_options = "-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Druby.no.kcode=true"

You have to restart your netbeans to see the effect.


  1. Thanks sooo much for taking the time to post this!!

  2. Thanks JP for your comment. Hope that it helps someone who will face the same issue.

  3. Thank you! That was helpful.

  4. Thanks a lot, had the problem while try to running rspec tests in Netbeans on 1.9.1