REE installed & working, but rubygems load error persists in cmdline

Gents,

After a LOT of struggling, I managed to install REE + Passenger on Solaris and everything seems to work when Passenger serves the applications. But there's one annoying details still pending: when I invoke rails from the cmdline (for example: rails -v) it fails due to rubygems load error (require 'rubygems'). Why does it work under Passenger and not in the cmdline? Any clues on what's wrong?

Cheers, Sazima