Friday, October 24, 2008

Using custom column type in Rails migrations

It seems if the type you gave to a column definition in a migration is not listed in native_database_types, Rails will just use what you gave it.

Therefore this will work:

Wednesday, October 8, 2008

Obi-Wan vs Yoda

I just realized this the other night while watching The Amazing Race though it seems to have been talked about since Episode 3 was released.

Obi-Wan:
Only a Sith deal in absolutes

Yoda:
Do, or do not. There is no try.


Friday, September 12, 2008

Rubyforge gem problem

Problem:

starting the server and you get:
 can't activate rubyforge (= 0.4.5), already activated rubyforge-1.0.0] (Gem::Exception)

Solution:
remove old versions of rubyforge gem
jorrel@helen ~ $ sudo gem uninstall rubyforge

Select gem to uninstall:
1. rubyforge-0.4.4
2. rubyforge-0.4.5
3. rubyforge-1.0.0
4. All versions
> 1
Successfully uninstalled rubyforge-0.4.4
jorrel@helen ~ $ sudo gem uninstall rubyforge

Select gem to uninstall:
1. rubyforge-0.4.5
2. rubyforge-1.0.0
3. All versions
> 1
Successfully uninstalled rubyforge-0.4.5
jorrel@helen ~ $ gem list | grep rubyforge
rubyforge (1.0.0)

Tuesday, June 17, 2008

Undo uncommitted changes in git

It seems that 'git revert' does not work the way that 'svn revert' does (reverting all uncommitted changes). I don't know if this is the proper way, but I 'reverted' my changes using 'git stash':


git stash
git stash clear

Update:

git reset --hard

Monday, April 28, 2008

Ubuntu Hardy + Firefox + Firebug

The old firebug is not working for firefox 3 beta 5 in Ubuntu Hardy; and so firebug 1.1 from the official site.

Solution: get the 'firebug' package from apt. :)

Tuesday, April 22, 2008

mod_rails + edge rails

Based on a recent conversation at phusion passenger google group, there is a bug wherein mod_rails fails to start its spawner for an application that uses edge rails.

Basically, you'll get this error (complaining about a failed 'to_constant_name' somewhere):

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

More info about the bug can be found in the bug report filed by hongli


update: This seems to be fixed in edge rails + git passenger (though I havn't tried yet), as hongli's comment below says.

Monday, April 14, 2008

mod_rails + rails 2.0

I you encounter a "500 Internal Server Error" after setting up mod_rails in a recent (rails 2.0) application, you need to delete 'public/.htaccess'.