Running Mephisto on Ruby 1.8.7
Posted by james on November 4th, 2008My server runs Ubuntu, and seeing as 8.10 (Intrepid Ibex) is out, I thought "woo, let's upgrade". Bad idea. Well, partly. Most of the upgrade went fine, but there was one problem. Intrepid comes with Ruby 1,8.7, which works fine with Rails >=2.1, but doesn't work with anything lower. Mephisto, on the other hand, doesn't work with Rails 2.1 yet, and is only usable with Rails <=2.0.2. So, you get an error starting Mephisto that looks like this:
So, I was faced with having to downgrade to Ruby 1.8.6 (a royal pain as Intrepid doesn't provide packages for it), or "fix" Mephisto to work with 2.1 (oh my god, don't even get me started). Fortunately, another solution presented itself.
I came across this blog post which describes the problem I was having. The gist (it's in Spanish) is that the main problem with Rails 2.0.2 and Ruby 1.8.7 is that Ruby 1.8.7 has added a String#chars function to the core language. Rails also adds this function, but the two have different return types, hence causing much breakage. The solution? Remove Ruby's String#chars and let Rails do its thing. Add this code to an initializer in your Rails 2.0.2 app, and it will work (better, at least) with Ruby 1.8.7.
begin String.class_eval { remove_method :chars } rescue NameError end
As you can tell by the fact that you're reading this blog, it works a treat. Hurrah!
EDIT: Another solution, which I only just worked out, would be to install the very badly-named Ruby Enterprise Edition, which sits alongside the system's Ruby and is call-compatible with 1.8.6. This makes a lot of sense if you're using passenger (mod_rails), as well.
Adventures with GitHub
Posted by james on May 9th, 2008When the Linux kernel moved to using git for version control, I didn't really pay much attention, to be honest. When Rails moved, I only really paid attention because it made my life harder, as Piston doesn't support git fully yet. However, I've now had a reason to use it myself, and I have to say I'm actually rather more impressed than I thought I'd be.
Read the rest of this entryA whole new look
Posted by james on May 9th, 2008Well, it was about time for an overhaul... my old site was looking increasingly outdated, and it didn't really fulfill what I wanted from it any more, so I've moved over to a new one, using Mephisto. It's deployed on my own virtual server, and is running under Phusion Passenger, the new mod_rails solution for Apache. It's definitely been the easiest Rails installation I've ever done! Not sure how well it would stand up to heavy use, but this site certainly doesn't need to be high-capacity, so it does the job admirably.
The hardest thing about getting the new site up and running was deciphering Mephisto's liquid code. While there is *some* documentation, most of it seems to be out of date and scattered across the net, so it was a bit awkward. I'm sure you can expect a couple of blog posts detailing exactly what I had to do to get the site into a good shape at some point...