MySQL mayhem with Rails 2 and Windoze.
There is something very wrong with the combination of Rails 2, MySQL and Windows. The default installation of MySQL has “sql-mode” enabled by default which causes RSpec tests to fail miserably when handling dates. And these are run of the mill sort of dates too a-la TIme.now.to_s(:db). Nothing special. Disable sql-mode in the MySQL Administrator application and viola! the specs pass.
But the pain does not end here. Rails 2.2, with the installed MySQL gem (the compiled one) segfaults. Null pointer exceptions all over the place. Furthermore, if you happen to be running Rails 2.1 and you also happen to have the MySQL native gem installed, be prepared for more segfaults.
So here is the Rails 2 setup with MySQL that has worked for me:
- Rails 2.1
- gem uninstall mysql
- sql-mode=”” (Turn off SQL mode in the MySQL Administrator app)
Happy coding, monkeys!
