rails problem on new installation

I've just installed my first batch of RoR.

I've got:

ruby version 1.8.5
gems 1.0.1
rails 2.0.2

When I try to build the skeleton app with:

rails myApp

I get the following errors:

/usr/bin/rails: line 9: require: command not found
/usr/bin/rails: line 11: version: command not found
/usr/bin/rails: line 13: syntax error near unexpected token `('
/usr/bin/rails: line 13: `if ARGV.first =~ /^_(.*)_$/ and
Gem::Version.correct? $1 then'

Do I have a compatability problem with some of my versions of ruby,
gems, and rails?

Okay. I figured this out myself, but incase someone else has the same
problem, I'll tell what happened.

First of all, I am using debian linux. One of the conventions of
debian linux is to set environment variables that applications require
with a wrapper script around the binary. In this case, I wrapped the
ruby binary with a script that sets the RUBYOPT=rubygems, as suggested
in the gems user manual, post installation section.

Something about this extra layer of indirection mucks up the
execution. I'm not sure what it is, but its probably not that
complicated. I'm just not that much of a scripter. I'll repost when
I find out so that others might learn.