If I can remember correctly I had to set env variable RUBY_LIB to it's corresponding path ... /usr/local/lib/ruby/site_ruby/1.8/ in order to get gems and rails to work ... may want to try that.