From: Sam Duncan Date: 2013-06-28T10:59:11+09:00 Subject: Re: #!/usr/bin/env: No such file or directory This is a multi-part message in MIME format. --------------090706000402000009060701 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 28/06/13 13:55, Todd Sterben wrote: > Thanks for the responses. I should have been a bit more clear about my > UNIX skills. Not great, but I can move around and set permissions and > look at things like environment variables. So I had already set things > to execute. I still can't see what is up. Here is the code(again) and > files and symbolic links & path & permissions > > Here is my beautiful code: > > #!/usr/bin ruby > > puts "Hello world!" > > which produces these errors: > > ./test.rb: line 1: #!/usr/bin: No such file or directory > ./test.rb: line 3: puts: command not found > > /usr/bin is in PATH so it should not have a problem there: > > /usr/lib/lightdm/lightdm: > /usr/local/sbin: > /usr/local/bin:/usr/sbin: > /usr/bin:/sbin:/bin: > /usr/games: > /usr/bin/ruby > > ruby points, through symbolic links, to /usr/bin/ruby1.9.1 > > lrwxrwxrwx 1 root root 22 Jun 20 16:30 ruby -> /etc/alternatives/ruby > > lrwxrwxrwx 1 root root 18 Jun 20 16:30 ruby -> /usr/bin/ruby1.9.1 > > > -rwxr-xr-x 1 root root 5552 Mar 22 12:14 ruby1.9.1 > > And the code is here: > > -rwxrwxrwx 1 john john 41 Jun 27 18:41 test.rb > > I am going to /home/john to run the file ./test.rb > > And everything is executable > #!/usr/bin/env ruby *or* #!/usr/bin/ruby Prefer the former over the latter =] Sam --------------090706000402000009060701 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 28/06/13 13:55, Todd Sterben wrote:
Thanks for the responses.  I should have been a bit more clear about my 
UNIX skills.  Not great, but I can move around and set permissions and 
look at things like environment variables.  So I had already set things 
to execute.  I still can't see what is up.  Here is the code(again) and 
files and symbolic links & path & permissions

Here is my beautiful code:

#!/usr/bin ruby

puts "Hello world!"

which produces these errors:

./test.rb: line 1: #!/usr/bin: No such file or directory
./test.rb: line 3: puts: command not found

/usr/bin is in PATH so it should not have a problem there:

/usr/lib/lightdm/lightdm:
/usr/local/sbin:
/usr/local/bin:/usr/sbin:
/usr/bin:/sbin:/bin:
/usr/games:
/usr/bin/ruby

ruby points, through symbolic links, to /usr/bin/ruby1.9.1

lrwxrwxrwx 1 root root   22 Jun 20 16:30 ruby -> /etc/alternatives/ruby

lrwxrwxrwx 1 root root 18 Jun 20 16:30 ruby -> /usr/bin/ruby1.9.1


-rwxr-xr-x 1 root root 5552 Mar 22 12:14 ruby1.9.1

And the code is here:

-rwxrwxrwx 1 john john 41 Jun 27 18:41 test.rb

I am going to /home/john to run the file ./test.rb

And everything is executable


#!/usr/bin/env ruby

or

#!/usr/bin/ruby

Prefer the former over the latter =]

Sam


--------------090706000402000009060701--