The other day I updated to Lion from Leopard. I know… I was keeping it real with an old OS but it got to the point where new apps where not working with leopard. While everything with the operating system update was fine there was a lot of time spent getting my ruby on rails install back up and running. One thing I did not understand is that I had made the leap to a 64bit system. This means a lot of recompiling as I hate package managers for osx.
Reinstalling MySQL
First things first you will need to recompile MySQL from source. I am using 5.1. It seems to be the version of mysql that everyone is using. Some people might stick with sqlite however as I would never use it in production I would also never use it in development so I stick with MySQL. These commands are taken from Dan Benjamin’s hivelogic blog. Great work Dan! The link to the article is below in the sources section so if you run in to trouble check the article out.
1 2 3 4 5 6 7 8 9 10 11 12 | |
Removing the old Ruby
After these steps you should have the database recompiled for the new architecture of Lion. Great lets move on. Its worth noting that I am using RVM. The first thing I needed to do after the update is remove my existing version of ruby. This is the 32bit version and will not work.
1
| |
Reinstalling dependencies
With that done we need to reinstall ruby 1.9.2. We can use RVM to do this however there are a few things we need to update before this. Lets start with libxml. Download the latest version and compile it.
1 2 3 4 5 | |
After this we need to install libxlst.
1 2 3 4 5 6 | |
All done now lets move on to readline.
Installing Readline
At the time of this writing I was unable to install readline via rvm packages. There is a patch that fixes this however I am not sure its in head yet. The catch here is that in the current state when you install readline it will say that the install has been successful. This is not true. There is a topic on the RVM mailing list about this. For the moment I was able to get around this by compiling and installing readline myself. I have no doubt that this will be fixed soon but for the moment you will need to take this step. This last step is done assuming that you have readline 5.2 downloaded and untared. If you need help then I can add the download link.
1 2 3 4 5 6 7 8 9 10 11 | |
Next lets install zlib and iconv and openssh via RVM.
1 2 3 | |
Installing Ruby
Now we can install ruby 1.9.2. This will install the 64 bit version for us.
1
| |
Finishing Up
Once you have recompiled ruby you will need to create a new gem set. For me I have a gem set for each one of my projects so it was a matter of creating the gem set again and then running a bundle install.
Sources
http://www.markhneedham.com/blog/2010/07/08/installing-ruby-1-9-2-with-rvm-on-snow-leopard/
http://stackoverflow.com/questions/6317980/bundle-rake-error
http://exceptionz.wordpress.com/2010/02/03/how-to-fix-the-iconv-require-error-in-ruby-1-9/
http://groups.google.com/group/rubyversionmanager/browse_thread/thread/4130f40a654242a6?hl=en
http://techdebug.com/blog/2009/01/03/compiling-readline-on-an-osx-105-intel-x86_64
https://rvm.beginrescueend.com/packages/zlib/
http://nokogiri.org/tutorials/installing_nokogiri.html
“` http://hivelogic.com/articles/installing-mysql-on-mac-os-x/