MetaSkills.net

Using RubyAMP TextMate Bundle With /opt Ruby

Posted On: April 25th, 2008 by kencollins

I've been a TextMate user for a long time now and I'm still finding new things to do with it. Here recently I wanted to use the RubyAMP TextMate Bundle and was a little miffed to find that it was pointing to my OS X system ruby. The error message looked something like this when it went looking for my ruby/gems.

No such file to load -- appscript (LoadError) from 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require’
...

How to use Passenger (mod_rails) with rails edge 2.1

Posted On: April 21st, 2008 by kencollins

If you are like me and have been using passenger, then you may have run into an issue when working with rails edge. I mean the REAL rails edge on Git, not that fancy rake task which I think is still pointing to a subversion snapshot. Let me take an aside on how to freeze rails edge to a project that you are managing in Git. This method is akin to using svn:externals. As a cop out, here are 3 links that you should read to learn how.

UPDATE: This issue has now been resolved in the official release.

OK... now that you know how to freeze the real rails edge to your git project, and if you have been using passenger, you may now have seen this error below. The basic problem is that passenger bypasses the work that the rails boot.rb does and in doing so, it only accounts for setting RAILS_ROOT during the ApplicationSpawner process and not the FrameworkSpawner process. In the latest rails, ActionPack is now relying on RAILS_ROOT to be set by calling Rails.root (shortcut method to that constant) when loading. So my fix was to add the RAILS_ROOT to the FrameworkSpawner class.

Framework that failed to load: Vendor directory: /Users/foo/project/vendor/rails 
Error message: Anonymous modules have no name to be referenced by 
Exception class: ArgumentError 

Resources

Now on Passenger (mod_rails)

Posted On: April 13th, 2008 by kencollins

Well this is working out well so far. I'm really liking the Passenger (mod_rails for Apache) extension. Right now I have this Mephisto site running it and it seems to be doing really well. Also, most people do not do this, but I run a full development stack Apache/MongrelCluster to mimic production boxes the best way I can. Now I am running mod_rails on all my development hosts.

Some Things I Like

  • I do not have to fuss with OS X launchd startup scripts for my mongrels, just Apache.
  • Typically in a high volume site that runs mongrel behind an Apache proxy balancer, will get a large timeout and proxy error even if the mongrels are immediately available. Passenger has a nice way to restart the app, just touch the tmp/restart.txt file.

Some Things I'm Waiting For

  • The RailsEnv can not be set per virtual host. You have to set RAILS_ENV = 'development' in each app if you want to run mixed virtual hosts with different environments.
  • Normally I would pass environment variables to the console when issuing mongrel cluster starts. I would really love to see Passenger support apache environment variables.
Tags:

Autotest Playlist For Red/Green Feedback

Posted On: April 6th, 2008 by kencollins

Here is how to get a playlist of sounds that will be hooked to both your autotest :red and :green callbacks. Basically this gives you a folder of sounds that are played one after another, in a loop, as your tests pass or fail. See this move below for a quick example.

Tags:

Autotest Infinite Loop On Failure & Error

Posted On: April 6th, 2008 by kencollins

I just had an issue pop up today that seemed to be an issue for a few others. It seemed that all of a sudden that my autotest was stuck in an infinite loop after a failure or error. At first I thought it was related to some additions to my ~/.autotest file but after commenting out the whole lot of additions there, I realized it was something else. Here was my fix. Basically I think these errors are always related to a file that has changed during your test run. Now we just have to find out what that files are. Here are the steps I took to find out.

Tags: autotest, rails, ruby

How To Stop Delivery Of An Email Within An ActionMailer Method

Posted On: April 3rd, 2008 by kencollins

OK, so you want to keep your code placement REALLY organized. You have read about my persnicketyness and now you want to practice the best in concern placement and keep those controllers of yours really slim. Like me, you may want to try and keep controller feature additions to very specific one liners of code. Organizing your controller code to do just that with ActiveRecord models or even your own custom classes is a pretty easy task, but how do you keep things simple when dealing with controller actions that have to send email AND you want that single email link of code to be responsible for everything in it's own encapsulated way.

MetaSkills.net Reborn on Mephisto

Posted On: March 21st, 2008 by kencollins

DraxWell after a year of neglect, the MetaSkills.net blog has been reborn on Mephisto. Previously I was using Drupal and it finally got to a point where I was so deep into ruby that I did not even have the gumption to open up a PHP session to publish anything. The sad part is that I told myself that this PHP disdain would help me get off my butt and move to Mephisto. You know, eat my own dog food – obviously procrastination won out – but not forever. For the past week I worked hard to get the Meta theme for Drupal converted to Mephisto. You can use this theme yourself if you want, the source is available on my github and I am making updates often. Heck... feel free to fork the project and make some changes or let me know if you want me to incorporate them into mine.