When Ruby goes off the Rails

I’ve been a software guy for a long time now, way beyond a decade, possibly two if I go back to my earliest days of code. The thing that amazed me about code was the potential, the logic, and the rigidly defined grammar of the languages; there was no interpretation, you had the knowledge and you made things happen. My first ever coded program bared the filename jotto.bas and printed my name to the humming green VDU of an Amstrad 6128+, life was good.

That was then and today is a very different world to the one I entered so many years ago. Some weeks back I dipped my to into the world of Ruby for the first time. I had heard much about this scripting language with attitude – promise of great power and little responsibility. Within 2 hours I had completed a decent tutorial on the language and I had achieved an unbelievable number of things such as object creation, database connectivity, test cases, and many other things but I had written none of them. I could only describe the experience as witchcraft. I was understandably in awe of its capabilities but cynically, advisedly and now rightly, fearful of what happens when it doesn’t go to plan? What happens when you have no control over the core of what you are doing?

I recently acquired a sophisticated Ruby development from a co-worker; my only task was to get it running so that I could utilise it rather than modify it. It was a fully working and well-implemented code base. However, try as I may, I could not configure the Ruby environment to allow the code to run. I had gems errors, incompatible library loading errors, duplicate add-ons causing conflicts, refusal to update or build desired gems, streams of errors even when things had worked but never told you that they had. It caused me pain, suffering and embarrassment that I could not configure an environment that was already supposedly (according to many developer websites) present on my Mac.

Today, I finally overcame the issues that prevented me from running the Ruby code base and it wasn’t for the lack of trying, hours spent researching each individual issue and pulling information from each trustworthy site, trying it on 2 different Macs and even a Linux virtual machine.

To word how I did this, is beyond me right now – perhaps someday I’ll return and make this a guide rather than a brain dump. However, a very large amount of thanks is due to the following websites for snippets of information that gradually allowed me to solve one problem at a time:

http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard

http://stackoverflow.com/questions/991708/rails-mysql-and-snow-leopard

http://forum.slicehost.com/comments.php?DiscussionID=672

I never imagined that a modular, plug-in based system would get into such knots or lack the self-discipline to clean-up or control the way in which modules are to be installed by default rather than leaving it to the uninformed masses to sort out. I never imagined that I would be forced to do some clean-up without being prompted to do so. Nor did I imagine that I would have to prep a system for downloading a gem or otherwise the gem installer would hang. The bulk of my trouble boiled down to the MySQL gem and getting Rails to download and install (it eventually did but never said that it completed successfully but rather ended with an error).

Perhaps I’m approaching the Autumn of my ability to learn new coding paradigms and thus my ability to understand and ride the flow of these new languages is suitably impaired. I guess it happens to us all at some stage but I lament the day that logic is stripped out of the coding world in favour of rapid development and rampant code generation for badly documented coding frameworks. I never had such problems with BASIC, C++, .Net, or Java or their associated development environments. Perhaps I’ve hit my Kryptonite? Perhaps I just had a very bad experience? What I do know is that I found no shortage of websites with similar problems to mine and few answers…

4 thoughts on “When Ruby goes off the Rails”

  1. Never had these problems with Java? The hours I have spent suffering getting basic Java apps to work is similar to the hours you spent getting the Rails app to work.

    I agree that Rails should have got this stuff right from the start and not let it fester. Even professional Rails devs get into trouble with older code with unsupported dependencies. But that is pretty much the same case for every modern framework I’ve come across. Nobody has solved the legacy dependency problem across multiple platforms.

    And without the frameworks you would have spent those hours setting up boiler plate database connection code, test harnesses etc.

    1. I guess everyone has their kryptonite. 🙂 While greatly ruffled by the lack of visibility I do still appreciate the sheer witchcraft involved in the wealth of code delivered for free and the time saving as a result of such. I just never found myself completely clueless before when it came to solving the problem – I was literally dumbstruck or perhaps these days just dumb, the old mind ain’t what it used to be. Perhaps I’ve entered the zone whereby I need to see things developed ground up, in order to understand them? Time to pass on from coding…

      1. That could be the problem. You come from an age where you saw things built from the ground up and you could fit the entire stack in your head. But now we are building systems that are too large to fit in one head. And kids are entering the craft at floor 4 instead of the basement. And they don’t think that is bad, they just get on with the tools they see before them and trust that underneath it all is a good foundation. Which I don’t think is automatically a bad situation. It depends on what you are building. Some systems you should understand from bare-metal up, other systems you just need to understand the frosting.

      2. That could be the problem. You come from an age where you saw things built from the ground up and you could fit the entire stack in your head. But now we are building systems that are too large to fit in one head. And kids are entering the craft at floor 4 instead of the basement. And they don’t think that is bad, they just get on with the tools they see before them and trust that underneath it all is a good foundation. Which I don’t think is automatically a bad situation. It depends on what you are building. Some systems you should understand from bare-metal up, other systems you just need to understand the frosting.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.