Merb Notes

Posted by Michael Wall Wed, 02 Apr 2008 17:55:00 GMT

Since my last post, I have been looking more and more at Merb. Just some random notes
  • Looks like Merb 0.9.2 got some fcgi love. That is what I want to try to replace rails on my shared host.
  • Get on IRC if you need help – irc.freenode.net#merb. Really, IRC.
  • If you can’t stay on IRC, go to http://groups.google.com/group/merb for a log
  • Use these sake tasks if you are running the latest. sudo sake merb:update merb:install will update core, more and plugins
  • merb-rspec is no longer in plugins, but included in core
  • Watch this from Confreaks. Worth the investment.
  • Most tutorials and articles are dated. This one helped though.

Looking forward to more from merb….

UPDATE: Having some trouble with typo’s caching. Going to repost this article.

New laptop

Posted by Michael Wall Thu, 06 Mar 2008 02:19:00 GMT

One more quick post. Last week I purchased an inexpensive (shall I say cheap) laptop from WalMart. It is a Toshiba A215-S5808. I booted once in Vista to burn a cd and them immediately installed Ubuntu 7.10. Almost all my hardware was recognized, except the wireless and sound. This post was very helpful in resolving those issues. It’s only been a week, but I keep asking myself, “Why did I code so long in Windows”.

Rails Shared Hosting and a little Merb

Posted by Michael Wall Wed, 05 Mar 2008 14:30:00 GMT

It has taken me almost 2 months to put this post together, but at the time, DHH’s article on shared hosting support for Rail was very timely. I use shared hosting to run this blog and have had some headaches. This is another great post on the subject. Lots, and I mean lots, of interesting comments. Part of those 2 months was getting through those comments.

So what can we do? Rubinius / mod_rubinus seem really interesting. Long term, this may be a great solution. More immediately, I am intrigued by Rack. Rack is just a webserver abstraction and would not solve the lack of threading in Rails though. But there is a Rack adapter built into Merb, which is thread safe. I will be spending some time looking into Merb and I’ll document my investigation here.

So what headaches have I had with shared hosting. Only a few, because this site doesn’t get much traffic. Here are some details about my setup (warning, here comes an ad). I have the “Small” plan from asmallorange (ASO). The price is very reasonable and the features are good: SSH access, Rails support, unlimited mail accounts, unlimited mysql databases, unlimited subdomains and many other features. Support has been great, they have installed every gem I have asked for within minutes without a hard time, even Camping but that is a story for another time. ASO also has a reseller plan so you can sell off part of your hosting and make a little money. Ok, back to the post.

So what problems have I had with shared hosting? Like most shared hosts ASO uses FastCGI to support Rails. Mongrel is too expensive in a shared hosting environment. My problems have been with FastCGI and limits ASO has in place. They allow 5 instances of FastCGI to run concurrently. Again, no problem with the amount of traffic I get. However, idle instances die after 4 minutes. So at some point, all my instances die and the next request has to startup FastCGI and then serve the page. It can take 2 minutes, which is too long. There are some reaper and spinner scripts in Rails, but I don’t have enough permissions on my server to run them.

Another problem I had came from wanting to mimic my production environment as closely as possible on my laptop. I tried in vain to install Apache with FastCGI. Yes, it is windows and I was using Cygwin, but after 2 weeks of off and on install and configuration failures, I gave up.

If FastCGI is running, I have had no complaints with performance. You can judge that for yourself. I don’t fault ASO either. The restrictions they place on FastCGI make sense for their business model. Shared hosting for Rails is hard, and I think they have done a good job accommodating the community so far. I would recommend them if you want to support for multiple languages, if you are looking for really inexpensive hosting, and if you understand what you are getting into. Certainly they are good as Dreamhost All the other Rails apps I work on are run with mongrel clusters. Currently, I think that is best option for production sites with a decent or even large amounts of traffic. I’ll be interested to see if Ezra recommends anything else in his new book

Vim and Rails

Posted by Michael Wall Thu, 17 Jan 2008 16:24:00 GMT

I do almost all my development using vim/gvim. Vim is great. Yes, I have tried IDEs, and will use Eclipse when doing some java work. Ever since I started developing in Rails though, it has been me and vim.

I see lots of posts with rails code. Many of them are from Textmate, a Mac text editor, and the VibrantInk color scheme looks great. I already use rails.vim which is a great plugin by Tim Pope for rails development. He has also released a color scheme based on VibrantInk called vividchalk. There is another VibrantInk port for vim oddly enough called vibrantink.vim. Both are really good, but I use the vibrantink.vim color scheme getter for couple of reasons. One, it looks better in console vim. Two, the italics in vividchalk through me off.

Here is a screenshot from flicker with a comparison of the 3 made by Jo Vermeulen, the guy who made vibrantink.vim

Typo doesn't have stats

Posted by Michael Wall Tue, 01 Jan 2008 17:14:00 GMT

Now that I have used typo for a couple of days now, I realized it is missing page stats. Maybe it is vanity, but if I am going to spend time posting information, I want to know when someone is looking at it. So I looked on the mailing list and didn’t see anything current that would help. My first thought, right on, now I have a chance to write my first open source plugin. Then I came to my senses and decided to google around.

I found a post on Juixe TechKnow about a plugin from Graeme. Looked pretty good and I have been wanting to try google analytics. I also found this plugin which appears to be an updated version of Graeme’s. I tried the blue egg edition, but was getting errors about a missing Liquid constant. Didn’t feel like adding liquid so I went back to the first plugin.

Install and configuration was simple. Signed up for google analytics, installed the plugin, modified my environment.rb. Now I am collecting stats.

I did run see this discussion on the mailing list about gathering stats from feeds. I have already signed up for feedburner and replaced the syndication sidebar with a static one.

Should I be concerned? Everything has been too straightforward.

The only issue I see is that the plugin uses the older version of google analytics tracking, urchin.js. Last month, google launched a new script, ga.js. See here for more info. Maybe I’ll update the plugin. I also want to check to see if typo is caching the javascript file or downloading it every time.

BTW, Happy New Year.

Hail to the Redskins 1

Posted by Michael Wall Mon, 31 Dec 2007 03:01:00 GMT

Congratulations to the Washington Redskins as they finish the season with a bang and make it into the playoffs. It has been an especially emotional season for us die hard and the wanna be fans alike. Good luck in the post season. R.I.P. #21

Photo from http://www.washingtonpost.com/wp-dyn/content/photo/2007/12/30/PH2007123002197.html

New site

Posted by Michael Wall Mon, 31 Dec 2007 02:39:00 GMT

Well, nothing like waiting until the last minute. My personal weblog has been down for over a year. One of my 2007 new year resolutions was get it back up. Here goes.

Over the past year or so, I have been doing mostly Ruby on Rails work, both personally and professionally. I had to find another job about 3 months ago, and I was dreading having to go back to Java. RoR is just so much fun. I wanted to set my new weblog with RoR and looked at both Typo and Mephisto as well as few others. Why did I choose Typo? I think it was after listening to Stuart Halloway’s podcast. So far so good. I have to say, I am surprised by how easy it was to get set up and going. Much different than my experience with drupal 6 years ago. Surely I know more now, but I am still surprised. I’ll post more info about the set in the about page

I plan to blog mostly about technology, things I find interesting and things I learn. Maybe someone will find it useful.

Thanks for stopping by.