Fixing: undefined method `require_gem’ for main:Object (NoMethodError)

After upgrading to the newest version of rails (2.2.2) I was getting this error:

administrator@shuttle:~$ rails -v/usr/bin/rails:17: undefined method `require_gem' for main:Object (NoMethodError)

Anytime I called “rails” I would get this error and could not get past.

Here is the fix

administrator@shuttle:~/$ sudo vim /usr/bin/rails

Look for anywhere in the file that calls “require_gem”, I found it in only one spot:

require_gem 'rails', version

And change “require_gem” to just “gem” so:

gem 'rails', version

Save and when you run “rails -v” you should see this:

administrator@shuttle:~/$ rails -vRails 2.2.2

You should no longer get the error with running “rails”

Tool of the Day: WordPress Notifier for Mac OS X

An amazing tool came to my attention today, the WordPress Notifier. Similar to the Google Notifier it sits in your OS X status bar and alerts you when you get new comments to your blog. This is great because it allows you to react and respond quicker without having to keep your wp-admin page up all day or constantly get emails when you have other work to do. It even uses growl for the notifications.

It works with WordPress 2.7+ or but does not yet support WordPress MU. I encourage everyone who has a wordpress blog and uses a mac to take this for a spin.

View WordPress Notifier Web Site

Download WordPress Notifier 0.4