Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent error "code converter not found (UTF-8)"?

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.

like image 712
dgmdan Avatar asked Mar 27 '12 17:03

dgmdan


1 Answers

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).

like image 151
Josh Avatar answered Sep 19 '22 22:09

Josh