Yet Another Guide to Installing Mephisto on Dreamhost

Posted by labrat

UPDATE: mede.us: Mephisto and Dreamhost is the best guide that works so far. I've updated my post to reflect this. 12/2/2006 I've finally gotten Mephisto to run on Dreamhost. The process was a bit painful so here's the rundown. If you're not on dreamhost, log into your server with ssh via terminal. Use the following to check out from svn (this will make upgrading easier at a later date): svn co http://svn.techno-weenie.net/projects/mephisto/trunk my_mephisto_blog_directory If you are on dreamhost, log into your server via ssh and download the most recent stable release: curl -O http://s3.amazonaws.com/mephisto-blog/mephisto-0.7.3.tar.gz tar xzvf mephisto-0.7.3.tar.gz mv mephisto-0.7.3.tar.gz my_mephisto_blog_directory Follow the dreamhost wiki to install local gems (needed for tzinfo). Then you should be able to do the following: gem install tzinfo If not here's an alternative way. If you can't get mephisto running on dreamhost the most likely culprit is tzinfo. If the gem install is successful, type the following into your terminal: rake gems:freeze GEM=tzinfo Sometimes that's not enough. If so try the following(you might need to get an alternate download location since mirrors change): curl -O http://rubyforge.iasi.roedu.net/files/tzinfo/tzinfo-0.3.1.tar.gz tar xzvf tzinfo-0.3.1.tar.gz mv tzinfo-0.3.1 my_mephisto_install/vendor Go back into the terminal and change directories to your mephisto installation and type: rake rails:freeze:edge Go to your Dreamhost web control panel and in Domains>Manage Domains, edit the domain of your blog to check FCGI support and point the home directory to the public folder: Web Directory: /home/username/my_mephisto_blog_directory/public/ Set up all your databases for production, development, and test. Modify database.yml accordingly. Also modify .htaccess (should be line 32) to enable fcgi. It should read: RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] For the config/environment.rb comment out the following on line 5(remove the \#): ENV['RAILS_ENV'] ||= 'production' Now go to your mephisto directory via terminal. First, chmod public and log directory to 0755, then type the following: rake RAILS_ENV=production db:bootstrap Go to your_blog_domain/admin and you should be able to login with the username: admin & password:test. The proof. As you can see, I'm still using Typo. Actually, I'm a little on the fence right now. As much as I've grown used to Typo, the mind-share is clearly tipping towards Mephisto. The official rails blog is obviously on Mephisto and so is Tobi's! When the creator of Typo goes Mephisto that really says something. The Typo team is working quite hard at re-factoring the code and they even checked in a major change that incidentally broke my typo. However, I'm also finding some calls to the controller in model code. Plus the code-base is radically different. Mephisto still weighs in at half the LOC of Typo but has stuff like multi-blog management and such on the way with more advanced resource management. It's more of a lean/mean CMS with blog capabilities. It could be a serious contender against WordPress or Movable Type in the near future. You really can't beat the beauty and simplicity of a two-man team (including a monster coder that writes a 300-line forum app in his spare time) that includes a great coder and talented designer. But then again, I'm a little too lazy to go through with the hassle so I'll wait until the dust settles which means no migration and no more "svn up" on this Typo either!

mede.us: Mephisto and Dreamhost

RubyGems - DreamHost

Ruby on Rails - DreamHost

Hoopla ยป Installing Mephisto on DreamHost

Comments

Leave a response

  1. DangerAugust 20, 2006 @ 06:52 AM
    Wow, your guide is way better than mine, thanks for this!
  2. Piers CawleyAugust 20, 2006 @ 07:49 AM
    I think we've fixed your issue. And if it's still broken that's useful to know too, it just means I've got to write a slightly more paranoid migration. By the way, there's nothing intrinsically wrong with having the model call back to a controller. There are places where we wish there was another way, but I'd rather write a_model.render_on(self) class Article def render_on(controller) controller.render_article(self) end end class Comment def render_on(controller) controller.render_comment(self) end end than case a_model when Article render_article(a_model) when Comment render_comment(a_model) else whatever end Except, of course, rails makes you write: class Article def render_on(controller) controller.send :render_article, self end end Which is uglier than it needs to be. Then again, we've recently eliminated a whole bunch of calls back to the controller because we've rejigged how textfilters work.
  3. LabratAugust 20, 2006 @ 02:34 PM
    Danger, I took my cue from your writeup so thank you. I also snagged myself on the Mephisto subdomain thing. Maybe something for the future as Typo's still a good blog engine. Piers, Well, thanks for coming all the way over. To answer your first question, yes and no. Yes, the migrations come through but now I have two issues. 1. Themes are broken Scribbish is broken (individual articles don't show the content). Hence, I'm back on the even more generic Azure theme (it's probably a simple template fix in line with the aforementioned controller stuff ). 2. I can't delete articles from the admin panel This could also be a controller related issue as well. When I try to delete an article, all I get is a 500 app error. I'll have to go into the console I guess. I'll try fishing out the something from the log and post it to track a little later. First of all I want to thank you for all your tireless efforts (along with Scott) to improve on Typo. I'm very happy that someone picked up the ball where Tobi left off. Spam filtering and such (though trivial to implement with akismet) brought some of the finer touches to a much needed upgrade. Although I can understand your reasons for implementing the design decisions that you have it still doesn't feel right with the recent move to RESTful urls. It also broke some stuff so I'm hoping tests will catch those in the future. I'm pretty much coming along for the ride on edge/trunk (until these issues are resolved) so I do wish you the best! These are just my opinions. Thank you for the hard work.
  4. Piers CawleyAugust 20, 2006 @ 05:27 PM
    Yeah, we have a bunch of issues on the trunk I'm afraid. Lots of things changed, and lots of things broke as a result. Boy does our test suite need improving. Anyhoo... 1. The Scribbish issue I think you were having has been resolved. 1. I'd not noticed issues with deleting articles. I shall take a look, thanks. 1. I shall definitely be investigating making things a good deal more RESTful. I've been REST infected for a while now (I think the first time I looked at Rails, not long after DHH announced it I complained that `:controller/:action/:id` was back to front and `:controller/:id/:action` was way more Restful, if a little harder to implement). Anyway, I've been taking a closer look at Mephisto, and there's lots to like about it. Some of the feature decisions we've taken with Typo (in particular supporting future publication and RSS based sidebars) have made it very hard to do some of the things that Mephisto manages with page caching, but I'm looking into that side of things.
  5. LabratAugust 20, 2006 @ 08:44 PM
    Thanks for the quick response! I can say that everything is working beautifully now. For some reason the Javascript comment for scribbish doesn't drop down properly when I try to leave url/email on OSX Firefox but does it's thing on Safari. It's a very minor and cosmetic thing (I'll empty the cache and retry later).
  6. LabratAugust 20, 2006 @ 08:51 PM
    Test comment. Actually, everything is in order now. False alarm...
  7. GregNovember 01, 2006 @ 03:44 AM
    Thanks for the great guide... I can't seem to find .htaccess in my Mephisto_install_dir/public though (I do see my .cgi files)! I am looking in the right place, aren't I?
  8. LabratNovember 01, 2006 @ 04:39 AM
    If you are viewing it from regular folders on either windows or OS X, the chances are that it's hidden in the GUI. Try listing the folder contents from a terminal or use one of the many FTP programs. That should reveal it. It is there if you downloaded it from the source. You just have to squint a little.
  9. GregNovember 01, 2006 @ 05:24 AM
    Thanks. I use Transmit on OS X and went View > Show Invisible files. That yielded nothing. Just to be sure, I tried ls -a from the command line and still nothing as well. Very strange... I've downloaded Mephisto 0.6.1.
  10. GregNovember 01, 2006 @ 06:12 AM
    Alright one more comment. Check out the fruits of my labour here: http://rails.sixminutes.ca/ As you can guess I'm not very happy. I decided to follow the Mephisto Quick Install instructions. At the command line I've run 'gems list' and I see the following: tzinfo (0.3.2) Daylight-savings aware timezone library ... so I'm okay there. However, when I run 'rake db:bootstrap RAILS_ENV=production' I get one of two errors (the former is the more frequent of the two): rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1822:in `load_rakefile' ... and rake db:bootstrap RAILS_ENV=production (in /home/.sambo/gmacgregor/rails.sixminutes.ca) mkdir -p /home/.sambo/gmacgregor/rails.sixminutes.ca/config/../log rake aborted! undefined method `autoload_paths' for #Rails::Configuration:0x40733268 ...No database tables have been created and I can guarantee that my database.yml file is okay. Really appreciate the help... Cheers! Greg
  11. LabratNovember 01, 2006 @ 06:35 AM
    I understand where you're coming from because I've been there many times. Regarding the two errors, the second indicates you didn't check out edge rails into your vendor folder (if you have edge then it's usually tzinfo or any other dependency). Did you unpack the files from the terminal? Double-clicking and unpacking can screw files up. You can always copy a fresh .htaccess into the public if you need to. If you have terminal access, getting it from subversion is best with: svn co http://svn.techno-weenie.net/projects/mephisto/trunk name_of_your_directory Once you have the database.yml and set the right permissions from the directory. chmod 0775 db chmod 0777 log chmod 0775 public chmod 0666 log/*.log chmod o+x public/dispatch.fcgi Run "rake db:bootstrap RAILS_ENV=production" or even try "script/server production" and check http://rails.sixminutes.ca:3000 There's always one small oversight getting in the way. All I can advise is patience. Try to make your own checklist and go through those or start over fresh (keeping that database.yml) and taking notes as you go. Once you get it working, copy that entire folder as a backup too! Definitely hang in there. Once you figure out the gotchas they usuall apply to any rails application.
  12. GregNovember 03, 2006 @ 04:15 AM
    Hey... Just wanted to let you know that I finally got the install running. I can't say that I did anything different compared to my previous attempts but for whatever reason it just worked this time! Thanks again for the help... mucho appreciated! Cheers! Greg
  13. LabratNovember 04, 2006 @ 07:11 PM
    I'm glad to hear that. Unfortunately, that's the way it is with rails. Even advanced rails developers go through these things from what I see on the blogs. My advice: before you touch that thing again be sure to simply copy that entire folder and everything in it for a quick roll back. On a VPS or dedicated machine it's a lot more manageable since you control the entire environment. Plus with Capistrano you can define a lot of rollback and repair tasks. Thanks for dropping by! I've added your feed to my reader.
  14. Tim C.November 25, 2006 @ 07:32 AM
    Great tutorial. I have sailed through up to the last instruction, and i'm hitting a problem. I've attempted to do this 3 times and get the same response, so now I'm raching out... I have followed all the instruction starting at the beginning. I have installed tzinfo (it's listed as Local Gem when running 'gem list'). I sussefully ran 'rake rails:freeze:edge', and changed the files per the instructions. However, when I go to run 'rake RAILS_ENV=production db:bootstrap' it get: [tab]$ rake db:bootstrap RAILS_ENV=production (in /home/.osborne/tjcrandley/flyoverjuction.com/blog) rake aborted! Don't know how to build task 'db:bootstrap' Any ideas? Thanks in advance! Tim C. tjcrandley@gmail.com
  15. LabratNovember 26, 2006 @ 04:50 PM
    Tim, Someone commented on a similar problem above. All I can do is reiterate, make sure the permissions are set properly: chmod 0775 db chmod 0777 log chmod 0775 public chmod 0666 log/*.log chmod o+x public/dispatch.fcgi Try "touch public/*" and "killall -9 ruby" to shutdown all other ruby processes and try again. That may or may not work.
  16. LabratNovember 26, 2006 @ 05:04 PM
    Also, you might want to type "which ruby" and make sure it matches the #! line in the dispatch files under public. Hope that helps...
  17. Anton KovalyovNovember 26, 2006 @ 06:16 PM
    Thanks! It works!
  18. CarterNovember 28, 2006 @ 12:22 AM
    I recently created an account with Dreamhost and came upon your instructions for setting up Mephisto. Despite following all of the steps outlined about, I get the following error: >rake RAILS_ENV=production db:bootstrap (in /home/.margalit/crabasa/mephisto_trunk) >mkdir -p /home/.margalit/crabasa/mephisto_trunk/config/../log >rake aborted! >undefined method `class_variable_set' for WhiteListHelper:Module The same problem was posted on the "Beast forum":http://beast.caboo.se/forums/1/topics/647?page=1#posts-1837 but no fix was given. Ruby 1.8.2 is installed on my Dreamhost machine (sunkist).
  19. LabratNovember 28, 2006 @ 03:00 AM
    That indeed seems to be a 1.8.4 feature. Check the guide to compiling your own ruby for Dreamhost: http://wiki.dreamhost.com/index.php/Ruby\_on\_Rails\_Installation
  20. CarterNovember 28, 2006 @ 05:23 AM
    Thanks, I finally figured that out and have created my own versions of ruby, gem and even rake. However (and this is hours and hours of trying) I have not been able to get Mephisto running with FCGI. I can get Mephisto running either via script/server or plain-jane CGI. I can also get a fresh Rails app working with FastCGI. But I can't get Mephisto/FastCGI working. The call to the URL hangs and error are printed to the Apache error log: FastCGI: incomplete headers (0 bytes) received from server I've tried everything that Google has given me regarding Dreamhost/Rails/FastCGI tweaks. I've pretty much given up. What machine are you hosting on and what version of Mephisto are you running?
  21. LabratNovember 28, 2006 @ 12:26 PM
    Actually, it seems like something killed my demo blog between the time I posted this and now. You might want to take a look at someone who's had success: http://johnnunemaker.stikipad.com/jn/show/Rails+on+Dreamhost I can't find anything new there and am in the process of asking DreamHost what's up. My suspicion is that they're killing Mephisto or making it hard to run for memor/resource considerations. Not sure yet. Personally, I'm leaning toward switching to WordPress if memory becomes such an issue. I have a VPS that I know I can run Mephisto on but wasted memory is not what I'm looking for. Sorry I can't be of much help here.
  22. NickDecember 01, 2006 @ 11:34 PM
    I was having similar issues to Carter and finally figured out how to get Mephisto up: http://mede.us/2006/12/1/mephisto-and-dreamhost Thanks for the help Labrat...
  23. Julien MarieMarch 19, 2007 @ 10:38 PM

    I’ve done an upgraded and simple guide to install mephisto on dreamhost. You can find it here : http://www.julienmarie.com/2007/3/19/installing-mephisto-on-dreamhost-a-new-guide

  24. HoodiaApril 09, 2008 @ 02:02 AM

    best site

  25. AlliApril 12, 2008 @ 04:38 AM

    Best loss

  26. EnzyteMay 13, 2008 @ 03:09 AM

    best price

  27. 341 meetingJune 05, 2008 @ 04:30 PM

    Nice Site! http://google.com

Comment