Installing Mephisto 0.8 on Rails 2

0

Finally I'm done with installing and running mephisto for my personal website. However, it was not that easy, so I thought documenting it may help me in the future and may save someone else's time. Actually, a lot of time.

Well, if you don't know, mephisto is a simple, elegant and free Ruby on Rails blogging system that can run fantastic websites. Unfortunately, due to the lack of documentation, especially after mephisto releasing mephisto 0.8, which supports Rails 2, it took me a long time to get it installed and running. The good news is that I will show you how I did it. So, to the tutorial...

    1.First of all, you should know that mephisto 0.8 has some issues with Ruby 1.8.7. You will have to downgrade to Ruby 1.8.6 if already upgraded. Actually, Rails itself recommends Ruby 1.8.6.

    2.To download mephisto 0.8, I tried github, but it did not install successfully. Finally, I found a working version at RailsPlayground. So, go to your hosting shell and download it: 3.Now, extract the file you downloaded:
    unzip mephisto-0.8-railsplayground.zip
    Then, rename the folder:
    mv mephisto-0.8 mephisto
    4.Log in to your hosting control panel and create a database, say mephisto_db, and a database user, say mephisto_dbuser. Then, make sure to assign the user to the database with all privileges.

    5.Change the file named database.example.yml to database.yml: 6.Edit the config/database.yml and update the production database definition to match the database and the database user you created:
    vi mephisto/config/database.yml
            
                            production:
            adapter: mysql
            database: mephisto_db
            username: mephisto_dbuser
            password: yourpassword
            host: localhost
    7.Update your application with the latest Rails:
     cd mephisto
            rake rails:update
    8.Create mephisto's database tables:
    rake db:bootstrap RAILS_ENV=production
    9.To install mephisto on your main domain, yoursite.com for example, you will need to create a symbolic link from your public_html direcotry to mephisto’s public directory. Remember to backup your public_html first:
     mv public_html public_html_backup
            ln -s ~/mephisto/public ~/public_html
    Congratulations! You can access your blog using this URL (the slash at the end is a MUST):

    yoursite.com/mephisto/

    And the admin site is:

    yoursite.com/mephisto/admin/

    10.To install mephisto on a subdomain, blog.yoursite.com for example, just login to your hosting control panel and create a new subdomain that points to mephisto/public. Now, you can access your blog using this URL (the slash at the end is a MUST):

    blog.yoursite.com/

    And the admin site is:

    blog.yoursite.com/admin/

    11.To access the admin site, use the username:admin and password:test

    Now, click the "Create new article" at the top to create your first article. You may get an error of Invalid encoding.

    Don't worry, I've made the search for you. The solution is to edit the vendor/plugins/permalink_fu/lib/permalink_fu.rb as follows:

  • Change line 9 to:
      s = Iconv.iconv(translation_to, translation_from, str).to_s
  • Change line 90 to:
    PermalinkFu.translation_to = 'ascii//ignore//translit'
  • Now, with your second try to add your first article, you may get another error:
    Define INLINEDIR or HOME in your environment and try again
    The solution is to edit the mephisto/config/initializers/custom.rb to add this:  
    ASSET_IMAGE_PROCESSOR = :none
    Now, the third trial should work.

Congratulations! You've just created your first article on mephisto. Now, you should change your password. And I recommend you also change your login name as it will appear as the author name for your articles.

Next time, I may talk about some useful plugins that you can install on your mephisto.

Written by:
Hatem Mahmoud (www.expressionlab.com)

Post a Comment

eSpace podcast Prodcast

RSS iTunes