MetaSkills.net

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

Tags: rails

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: rails

How To Stop Delivery Of An Email Within An ActionMailer Method

Posted On: April 3rd, 2008 by kencollins
Liquid error: Mysql::Error: Lost connection to MySQL server during query: SELECT assets.*, assigned_assets.label FROM assets INNER JOIN assigned_assets ON assets.id = assigned_assets.asset_id WHERE ((assigned_assets.article_id = 125) AND ((assigned_assets.active = 1)))

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.

Tags: rails

HomeMarks, My First Ruby On Rails Pet Project

Posted On: December 21st, 2006 by kencollins
Liquid error: Mysql::Error: MySQL server has gone away: SELECT assets.*, assigned_assets.label FROM assets INNER JOIN assigned_assets ON assets.id = assigned_assets.asset_id WHERE ((assigned_assets.article_id = 112) AND ((assigned_assets.active = 1)))
HomeMarks, Simple Project-Based Bookmarks
UPDATE: HomeMarks is now avialable as a free download.
Tags: rails

My Own Soup to Nuts Recipe for Ruby on Rails on OS X

Posted On: May 28th, 2006 by kencollins
Liquid error: Mysql::Error: MySQL server has gone away: SELECT assets.*, assigned_assets.label FROM assets INNER JOIN assigned_assets ON assets.id = assigned_assets.asset_id WHERE ((assigned_assets.article_id = 101) AND ((assigned_assets.active = 1)))

Tim Toady tells us that (There Is More Than One Way To Do It) and I am sure this is not the first and not likely the last blog post you will ever see that tells you the best way to install RAILS on OS X. Some people would just rather than go the simple path but I implore you, do it this way. Gaining the experience of compiling your own software will help you down the road when it comes time for doing more advanced things, especially deploying your RAILS app. When you are done, you will have a rock solid deployment environment for RAILS that will include:

Tags: rails

Pragmatic Studio Alumni Member

Posted On: May 18th, 2006 by kencollins
Liquid error: Mysql::Error: MySQL server has gone away: SELECT assets.*, assigned_assets.label FROM assets INNER JOIN assigned_assets ON assets.id = assigned_assets.asset_id WHERE ((assigned_assets.article_id = 100) AND ((assigned_assets.active = 1)))
The Pragmatic Studio Alumni Member

Well, I just got back this past weekend from the Pragmatic Studio in Boston and it was well worth the time and effort. If you have not yet used the RoR framework for web applications, stay tuned to my next post. By next week I will lay out an extensive tutorial on how to install the framework with all the proper goodies on your Mac. So do not wimp out and go for that easy package install and dare to impress your friends as we build our own software installs with Darwin Ports.

Tags: rails