From: Dennis Newbold Date: 2002-05-30T08:59:01+09:00 Subject: Re: Using modules when running from shebang! Hi Matthew, I had a similar problem recently, although your problem may be different than mine, and just have the same symptoms. After alot of hair-pulling, I found out thet the shebang line (#!/usr/local/bin/ruby or whatever) had a CR-LF pair at the end. Thus, the shell was trying to find a file named "/usr/local/bin/ruby\r" to run the script, and failing to find it. I ran the script file through dos2unix, and it worked fine. Your problem may be different, but its worth looking at it with a binary editor or whatever just in case. Dennis --------------------------------------------- | | | The way to be happy is to be good | | | --------------------------------------------- On Mon, 27 May 2002, Matthew Diephouse wrote: > I recently installed ruby-mysql from an rpm on linux mdk 8.2. When I run > my program from the command line `shell>./code.rb`, it fails, because it > can't find the module. But when I call it using the interpreter > `shell>ruby code.rb`, it works. How do I fix it so that it works the > first way? > > md |- m:att d:iephouse >