Installing Mephisto on Ubuntu 8.10

Justin / 19.Nov.2008

Note: this tutorial assumes you already have a working Ruby on Rails installation (installed via apt-get/aptitude with rubygems built from source). Bonus points will be awarded if you already have Ruby Enterprise Edition installed.

When it comes to Rails blog engines, there aren't too many choices; Typo and Mephisto are the two most popular packages, and both are rather stagnant in terms of development. Seeing as the Ruby world moves fast and the Rails world even faster, this can make it difficult to get either of these packages working with the current versions of Ruby and/or Rails. Ubuntu 8.10, the Intrepid Ibex from hell, has this problem. It took a few tries, but this blog is using Mephisto now, and I'd like to share the process that worked for me so you can get it running for your blog, too.

Ubuntu 8.10 comes with Ruby 1.8.7 and Rails 2.1.2. This is problematic for Mephisto in two ways: Mephisto only works with Rails <= 2.0.2, and Ruby 1.8.7 removes some Enumerate functionality that Mephisto relies on. But with a little maneuvering, we can get Mephisto working just fine. The process looks like this:
# install the required gem dependency:
sudo gem install tzinfo

# get Mephisto from GitHub
wget http://github.com/technoweenie/mephisto/tarball/master.tar.gz

# untar the file and cd into the directory
tar zxvf technoweenie-mephisto-*.tar.gz
cd technoweenie-mephisto-*

# put the 2.0.2 version of Rails on ice
rake rails:freeze:edge RELEASE=2.0.2

# use the 2.0.2 boot file in Mephisto
cp vendor/rails/railties/environments/boot.rb config/boot.rb

# create your production database
mysqladmin create mephisto_production

-- do the usual config/database.yml username/password/database setup--

# hack Mephisto to work with Rails 2.1.2 and Ruby 1.8.7
vi config/boot.rb and add the following lines at the top:
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION

unless '1.9'.respond_to?(:force_encoding)
String.class_eval do
    begin
      remove_method :chars
    rescue NameError
      # OK
    end
  end
end

# bootstrap the production database
rake db:bootstrap RAILS_ENV=production

# restart your webserver for good measure
sudo /etc/init.d/apache2 restart
Provided you did this in a web accessible location, you should be able to log into Mephisto now. The magic is freezing Rails to 2.0.2, updating the boot.rb file to force 2.0.2 to be used and overriding Ruby 1.8.7's Enumerate weirdness. If you're using Ruby Enterprise Edition, you can ignore the 'unless' section above since REE is still 1.8.6. Make sure to install tzinfo with REE's gem binary, though, or mod_rails will give you a nice FAIL message when you try to access Mephisto.

4 Comments

Thanks for these rails related posts. You've rescued me from hours of hair pulling on two separate occasions now. I'm a bit sad that the rails 'cms' (forums/blogs) ecology is a bit stagnant atm as well.
Yeah, the open source Rails ecology kind of sucks. Everyone seems far too focused on creating software as a service as opposed to distributing code for free. I'm looking at using Instiki (http://www.instiki.org/) for another project, but it's pretty dead, too.
Even you are using Ubuntu Intrepid Ibex 8.10, better to downgrade from Ruby 1.8.7 to 1.8.6, as usufull for more production servers for today. I have written the article about smart downgrade by using repo from Ubuntu Hardy: http://railsgeek.com/2008/11/27/ubuntu-8-10-downgrade-ruby-1-8-7-to-1-8-6
I refuse to downgrade. ;-P

Leave a Comment

back to top

© 2008; powered by ruby enterprise edition and mephisto