I really dread upgrading just about anything on my computer. It always turns into a huge waste of time. Today I upgraded Rails to the new 2.3 version and ran into a surprising number of problems:
1) Updating the gem was easy, and I created a new rails app to see it in action.
2) Trying to start the mongrel gave me:
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
3) Trying gem install mysql gave me:
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
4) I couldn’t find mkmf.log. Lots of googling found lots of people asking, and lots of different answers.
5) After trial and error, it looked like this one worked:
sudo gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
6) I tried out my new rails app, and got:
no such file to load — mysql
7) Again with teh Google! Again with the lots of questions and lots of answers!
8) It turned out I just needed to restart my mongrel.
9) I usually look at an example when running “generate scaffold”, but this time, since this is just a test, I just guessed about whether the controller name is supposed to be pluralized. I guessed wrong. (It is NOT plural)
10) Fortunately I use Beyond Compare to keep a shadow backup before doing any automated process, so I just reverted, recreated the scaffold, and SUCCESS!
Time wasted: 4 hours.