From: Gerry Ford Date: 2008-02-06T07:22:56+09:00 Subject: Re: how to say # in ruby Chris Hulan wrote: > On Feb 4, 8:20 pm, Gerry Ford wrote: >> My second question is about the shebang line: #! >> I was surprised to find that it matters what's written here when using >> the windows platform. There is no env folder in the bin folder, so if >> that's a path, then it's a path to nowhere. What "should" the first >> line say? >> -- > > I don't think it does matter on windows. > To execute a ruby file (say by double-clicking) you need to have the > file associations > configured. > > On *nix the shebang allows a similar function. > #!/usr/bin/env is not a path, it is the 'env' command in /usr/bin > #!/usr/bin/env ruby will find ruby on the PATH then execute it, saves > hard-coding the ruby path (but assumes env is in a standard location). Thanks all for responses. I do not have an 'env' command in /bin/, which is to say, when I type env into the dos prompt at ruby/bin/, I get "no such command" from dos. Maybe I'm in the wrong bin? This question appears to go to environmental variables. In the documentation, it suggests to type ruby -e 'puts $:' to see this information. As output, I get: C:/ruby/lib/ruby/site_ruby/1.8 C:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt C:/ruby/lib/ruby/site_ruby C:/ruby/lib/ruby/1.8 C:/ruby/lib/ruby/1.8/i386-mswin32 . , including that funny-looking period at the end. The site_ruby directories are intended to hold modules and extensions that you've added. The architecture-dependent directories (i686-linux in this case) hold executables and other things specific to this particular machine. All these directories are automatically included in Ruby's search for modules. #end excerpt from help I still fail to see how any of this has something to do with a shebang line like: #!/usr/bin/env ruby What /usr/ would be in this context is a mystery to me. -- -- Posted via http://www.ruby-forum.com/.