From: Tim Hunter Date: 2008-11-28T01:13:16+09:00 Subject: Re: Shebang! line not recognized in OS X Leopard?? Johnnie Lieske wrote: > Hi > > Newbie to Ruby. > > Going through the O'Reily book I get this bit of code for creating a > hello world script. The shebang line is suppossed to make it so I don't > have to type "ruby" before executing my scripts: > > #!/usr/local/bin/ruby > # a nice greeting for Matz > puts "Hello, Matz!" > > > Problem is that I get this when I run the script: > > Pinky:rubes pink$ matz.rb > -bash: matz.rb: command not found > > > I've searched everywhere for an answer but probably don't know how to > pose the question. > > The path to ruby on my computer is actually /usr/bin/ruby and not > /usr/local/bin/ruby > > I change the code in the script but still get the same error. > > It's stupid but I am anal and feel like I can't go on.... > > Any help greatly appreciated. > > Thanks! You should use the actual path to ruby on your computer. Also, make sure your script has its executable bit set: chmod +x matz.rb And finally, OS X only looks for executables your $PATH, which normally doesn't include your current directory. To execute a script in the current directory, do this: ./matz.rb -- RMagick: http://rmagick.rubyforge.org/