I recently updated the version of Ruby I was using on my Mac. My true impetus was the desire to get footnotes1 working on the Octopress blogging platform I use for this blog. I’m still relatively new to Git and Ruby since I don’t use them in my professional work.
After looking at the Octopress source code I found that a gem named RDiscount that seemed to perform the interpretation of Markdown syntax. In Ruby packages are called gems.
I simply needed a more up-to-date version of RDiscount that supported footnotes. My first thought was to use git to pull a new version of the package and update the dependency graph.
Octopress uses a gem called Bundler which provides an encapsulation for the dependency of gems among other things. I had already known of Jekyll and Sass but it was refreshing to see just how declarative the the dependencies were. When I first set up this blog I didn’t really take the time to understand all the components Octopress leans on.
Here’s a snippet of what the dependency tree looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
I had originally set up Octopress over a year ago any hadn’t touched any of the source code outside of customizations. The project was woefully out of date. I used the command
to update. Of course it failed citing dependency issues. Updating those dependencies failed with cryptic error messages so I said “fuck it, let me update Ruby to 2.*!”.
Looking over the Octopress instructions I attempted to use the command
At this point I really thought I had the latest version of Xcode. The OS X AppStore said I had didn’t have any updates. Moreover I have automatic updates enabled. I logged into the Apple Developer site and saw that there is indeed a later version of Xcode so updated to 5.0.2.
I tried again now to update the Ruby but instead got a new error. This time it was something about “Can’t find Tcl configuration definitions”. After some searching I discovered that I needed to update MacPorts which I had never heard of up until that point. I read that I needed to update the package to be compatible with Mavericks.
Ok, whatever, I won’t ask why a 3rd party open source project is needed for this. Perhaps Apple doesn’t want to focus any resources on creating an “easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based” software for OS X. Fair enough.
At this point things seemed to work with the rvm command. From there I basically reinstalled Octopress and finally got an updated version of RDiscount.
To trim down the length of this post I skipped some of the small issues that I also encountered such as:
- Unhelpful error messages really slow down the feedback loop.
- GCC 4.2 didn’t exist on my machine, I had to create a symbolic link to another GCC.
- The AppStore didn’t notify me that I didn’t have the absolutely latest version of Xcode.
- Some Ruby gems having generic error messages.
- I now have multiple versions of Ruby on my machine. I need to uninstall the old version.