Thoughts of a frozen geek

ArgumentError: invalid byte sequence in UTF-8

I came across this error while running my tests.

I am using Rails 3.0.3 + Ruby 1.9.2-p0 + RSpec 2.

The error ocurred when I tried to save some AR objects into my MySql database. The odd thing was that it only happened in 7 out of 10 times, or so. It was one those hard-to-trace errors.

The solution was to change my mysql adapter from mysql2 to ruby-mysql. Ruby-mysql is supposed to work better with Ruby 1.9 encodings.

So here is what I did:

1. Changed my Gemfile:

-gem 'mysql2'
+gem 'ruby-mysql'

2. Changed my config/database.yml

- adapter: mysql2
+ adapter: mysql

3. Ran "bundle install"

And that was all. After this change everything worked as expected.

Locos x Rails, yet the biggest Rails event of the year in South America.



Well, I think it may be a good start for this blog to talk about what took place last April in Buenos Aires, Argentina.

Me, and a group of other Rails developers from Uruguay, attended to LocosxRails, the first mayor Rails related event in Argentina.

For me, a Ruby on Rails developer, was a great oportunity to share 2 days with many of the referrals of the community, exchange some ideas with them, enjoy their talks and meet a lot of great people from other countries of South America, USA and Europe.

I must congratulate some of the members of RUGUY, Diego Algorta (oboxodo), Nicolas Sanguinetti (foca) and Evan Henshaw-Plath (rabble), for their great performance at the event.

You can read more about the event at LocosxRails website, and here you have the conference agenda with all the talks.

Also, Fabio Akita, from AkitaOnRails, posted a great video summary of the whole event, recommended!.

In the next few days, LocosxRails organizers will publish all the event related material like slides, talk videos, etc. I will post the link as soon as I get it.