(followed by a huge stacktrace). Googling didn’t help much, because every time anyone has asked about this on a forum, all of the answers are specific to Macs.

It turns out that the problem is that the mysql gem includes native code, which is built when you install the gem. And my existing mysql gem had been built against mysql libraries that are now, since my upgrade, out of date. So the fix turns out to be maddeningly simple. First, get rid of the gem that doesn’t work:

$ gem uninstall mysql

Next, get hold of the developer API libraries for mysql:

$ sudo apt-get install libmysqlclient16-dev

And finally, download and rebuild the gem again:

$ gem install mysql

Simples. I just hope this quick note saves you the hours of trawling through forums that I had to endure this morning.