This error will occur if you do not have a base ruby installation. This error was experienced when trying to install Ruby 1.9.2-p290. This was solved by:
1) Downloading an older version of ruby, such as http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz
2) Compile, and install it. Make sure the ruby executable are in the path.
3) Proceed with compiling the Ruby 1.9.2-p290 source.
A base ruby installation was required to upgrade to the newer version.
[root@computer ruby-1.9.2-p290]# ruby --version ruby 1.9.2p290 (2011-07-09) [i686-linux]