Got the above error whenever I was executing rake for my new rails 3.0.0 app in Windows 7.
Comment out the following lines from the rbreadline.rb file under C:\Ruby187\lib\ruby\site_ruby\1.8
This is really a huge file, opening in Word and then adding line numbers in the document may help you in commenting line number 4404. Though it may sound silly but I am adding the steps to add the line numbers in word document too.
File -> Page Setup -> Layouts -> Click on line numbers --> continuous
Line no 4404
and the following one
if defined? ''.getbyte
@encoding = "X" # ruby 1.9.x or greater
# @encoding_name = Encoding.default_external.to_s
For details the following URLs are really helpful