Over the holidays I upgraded my Mac to Mavericks, upgraded Ruby to 2.1.0 and upgraded Rails to 4.0. It was a fairly smooth transition aside from some issues regarding some linked files with Homebrew, but those were easily fixed after a bit of Googling.
Yesterday however, I started a new project only to find that I had errors with both sqlite and mysql2 gems. Neither version I had could be compiled. The project was properly scaffold but these errors persisted.
It turns out that during the scaffolding process (rails new projectname) bundle install is run at the end and since there was a problem with the gems I got a bunch of errors.
The solution I found (thanks Stackoverflow) was simple. The following steps worked for me:
1.gem uninstall mysql2
2.brew update
3.brew upgrade mysql
4.gem install mysql2
5.gem install sqlite3
After that the project scaffolded out properly and with no errors.