Ruby on Rails – mySQL and other fun

When last we left our intrepid Ruby/Rails explorer, he had just completed part I (chapter 5) and had a running toy application. He was preparing to create his first Ruby on Rails application that used mySQL. Of course, this would be the work of but a moment, because mySQL is always trivial to install, never has dependencies issues and is a pleasure to work with.

Oops.

OK, I admit that it’s been quite a while since I last installed and used mySQL, but the road to a running mySQL installation that will work with Ruby on Rails was, well, interesting. Of course, this book (properly) assumes that the reader has a working mySQL *development* system up and running. In my case, this wasn’t true, and I spent a little time taking care of that.

And then there was my inability to read tiny print at 2 am… There’s a vast difference between

$ sudo gem install mysql –with-mysql-lib=/usr/lib/mysql

and

$ sudo gem install mysql — –with-mysql-lib=/usr/lib/mysql

And that’s all I’ll say on the matter 🙁

So at this point, I’ve got Ruby, Rails, mySQL, the Ruby mySQL drivers and all the necessary include files and libraries up and running.