Tag : ruby

Ruby vs. PHP (Intro)

Written by Ken Nordquist on March 30, 2012

One of the key differences in the languages (Ruby vs. PHP) is the level of “object-orientation,” and (obviously) syntax. Ruby was designed from the start (~1993) to be an object-oriented (OO) language (EVERYTHING is an object) while PHP was, until recently (v5.0 – 2004), a procedural language. As a long-time PHP programmer who migrated to Ruby in 2006, I prefer Ruby’s implementation of Types and Objects over PHP's. I also prefer Ruby’s syntax AND coding best-practices over PHP’s.

Why is "Everything is an Object" in Ruby and not PHP?  (I know those of you who are ...

Short url : http://bit.ly/HzunT6

Painlessly Remove All Ruby Gems

Written by Ken Nordquist on Jan. 14, 2009

I noticed a lot of people searching for a way to delete all installed ruby gems and finding my Painless Cleanup of Ruby Gems With Similar Names page. I added this page for those of you who want to delete all installed gems instead of just cleaning them up.

Listing all gems is easy: gem list

OK, we can list our gems, but how do we delete them all? My list looks something like this:


abstract (1.0.0)
actionmailer (2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2, 1.3.6)
actionpack (2 ...

Short url : http://bit.ly/lXgr3v

Painless Cleanup of Ruby Gems With Similar Names

Written by Ken Nordquist on Dec. 18, 2008

I have been riding the bleeding edge of Merb and Datamapper for about seven or eight months. Whenever the source was updated at Github , I would pull in the changes, rebuild, then reinstall the gems. There was a time when the Merb and Datamapper contributors were bumping versions regularly and I was having problems with versions interfering with each other. I wanted only the latest and greatest gems installed.

Luckily Merb gems all start with ‘merb’ and Datamapper gems all start with ‘dm’. All I needed to do was write a shell command which lists all gems beginning with ‘merb ...

Short url : http://bit.ly/mkbmu0

Rotating Mongrel Logs

Written by Ken Nordquist on May 6, 2008

I am working on a Rails application using Apache and Mongrel on a Linux (Fedora Core) box. I want to be able to rotate the Rails logs to prevent them from taking up too much disk space. I found a number of blog posts / articles which had complicated(ish) directions to halt the mongrels, move (rename) log files, and then restart the mongrels. I knew there had to be a simpler way to handle this using the operating system. After much searching I ran into this blog post by Mike Mangino: Log Rotation with Mongrel.

I use Vlad the Deployer ...

Short url : http://bit.ly/k2xr9W