as others suggested you can do the following:

Link directly to your ruby executable:
#!/usr/bin/ruby

This line is called the shebang line, whenever your computer tries to read
a script, this line tells the computer what program to run this script
with. If you shebang to your ruby program directly, there is no issue. But
if you share the code, or install ruby to a different directory later on,
you have to change the line, some people might be using RVM, or have it
installed in #!/usr/local/bin/ruby instead. So we use the ENV program to
find the appropriate version of ruby in the PATH. #!/usr/bin/env ruby says
use the ruby that is returned by the env program. this way ENV returns the
ruby that is set for use in your systems path. This changes computer to
computer, so it is the most standard way of writing the shebang line to
make sure your code works on multiple machines. #!/usr/bin/env just dumps
your entire environment.

To see what I mean, type env in terminal and console. Then type env ruby
and see what happens.

Cheers,

Richard


On Wed, Jun 26, 2013 at 9:04 PM, Duong Quang Ha <quangduongha / gmail.com>wrote:

> Hello,
>
> Shebang line should like "#! /usr/bin/env ruby" or "#! <path to your
> ruby VM i.e /usr/bin/ruby>". This line tell shell which program to
> run.
>
> Regards,
>
> On Thu, Jun 27, 2013 at 10:58 AM, Todd Sterben <lists / ruby-forum.com>
> wrote:
> > I am new to both linux and ruby.  I am using Ubuntu and Ruby 1.9
> >
> > When I do which ruby, I get /usr/bin/ruby
> > When I do ruby -v I get ruby 1.9.3p0 (2011-10-30 revision 33570)
> > [i686-linux]
> >
> > When I try to kick off a simple script
> >
> > #!/usr/bin/env
> >
> > puts "Hello"
> >
> > I get
> >
> > ./test.rb: line 1: #!/usr/bin/env: No such file or directory
> > ./test.rb: line 4: puts: command not found
> >
> >
> > Why?
> >
> > Thanks
> >
> > Todd
> >
> > --
> > Posted via http://www.ruby-forum.com/.
>
>
>
> --
> Duong Quang Ha (H Quang Dng in Vietnamese)
> blog.haqduong.com
>
>


-- 
*Richard Wilson*
Proteous Trading Group
ph. - (604) 842 5318
Skype - r.crawfordwilson
email - r.crawfordwilson / gmail.com

°»*This email may contain confidential and/or privileged information. If you
are not the intended recipient or have received this email in error, please
notify the sender immediately and destroy this email. Any unauthorized
copying, disclosure or distribution of the information contained on this
email is prohibited°….*