7

I'm getting this error in my production environment (CentOS 5.6), but it runs fine in development (Ubuntu 11.04). In both environments, the app is using Ruby 1.9.3 and Rails 3.0.9 and is served with passenger and nginx. My mechanize gem version is 2.3.

code converter not found (UTF-8)

The last line of this code triggers it:

mech = Mechanize.new
page = mech.get("http://myurl.com/login.php?login_name=a&password=b")
form = page.form_with(:name => "loginForm")
form.field_with(:name => "active_pgm").value = '1'
page = form.submit

Any ideas? I do have config.encoding = "utf-8" in my application.rb.

dgmdan
  • 405
  • 6
  • 14

2 Answers2

1

Try changing your application.rb to read config.encoding = "UTF-8". I'm not sure why that would be an issue but it is worth a shot since the error complains about not finding 'UTF-8'(uppercase).

Josh
  • 5,631
  • 1
  • 28
  • 54
1

This is a longshot yet perhaps it will help you, because I saw similar errors on RHEL for other parsing gems.

The solution I found was not in Rails -- it was adding these lines to the system environment:

LANGUAGE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
joelparkerhenderson
  • 34,808
  • 19
  • 98
  • 119
  • Thanks but it didn't help. To keep my app working, I moved the production instance to an ubuntu machine and of course the issue doesn't happen there. I may try setting up a new centos machine and see if I get the same thing. – dgmdan Apr 03 '12 at 16:37