Archive for December, 2006

Ruby on Rails: Fail on rake db:migrate?

Tuesday, December 26th, 2006

I am learning Ruby on Rails by reading Agile Web Development with Rails Second Edition.

I have reached chapter six page 80. We want to add a new ‘price’ column. Unfortunately, running rake db:migrate gave me the following error:
rake aborted!
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]

I am using Locomotive (with the cool locomotive icon nonetheless!).

I did the following to resolve the rake aborted issue:
1. Open up your application from Locomotive in the terminal window.
2. Run the following command:
gem install rails –source http://gems.rubyonrails.org –include-dependencies
3. Edit your config/enviroment.rb set
4. Find and change the following:
RAILS_GEM_VERSION = ‘1.1.6.5618
5. Try rake db:migrate again and you should be OK now.

Setting Focus on Web Form

Monday, December 25th, 2006

Having a good user interface is very important for our websites and I have one new website design guideline.

If the user is expected to enter any data, we want to make sure that we set the focus appropriately on the right data field (e.g. text box or check box).

Setting the focus is very easy as well, so there is no good excuse if a website does not implement this feature.
(more…)

SVN Export

Friday, December 22nd, 2006

I set my class project incorrectly using svn. To make a long story short, I put my Eclipse workspace directory in the svn repository. (I know.. I know.. I have learned my lesson now).
Here is my directory structure:
Svn Mistake

(more…)