This has been bugging me for three hours! I keep receiving the error:
File not found. Even though I have placed it in the correct location. I
have no idea why it is doing it as I feel it should be working. Here is
the code:
Generally it's a good idea to learn how to use "File.dirname(__FILE__)" which gives the directory
of the current file. Play with it a bit and you'll figure it out!
Best Regards,
···
On 16 Ιαν 2013, at 15:07 , Adam Kennedy <lists@ruby-forum.com> wrote:
Hello guys and gals.
This has been bugging me for three hours! I keep receiving the error:
File not found. Even though I have placed it in the correct location. I
have no idea why it is doing it as I feel it should be working. Here is
the code:
email: atma@convalesco.org
URL: http://www.convalesco.org
GnuPG ID: 0xE736C6A0
gpg --keyserver x-hkp://pgp.mit.edu --recv-keys 0xE736C6A0
--
The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."
Ignoring all the other issues with your code, the likelihood is that
the process being run is *not* relative to where your program file
is stored.
Include the result of Dir.getwd in your program and find out.
···
On Wed, Jan 16, 2013 at 6:07 AM, Adam Kennedy <lists@ruby-forum.com> wrote:
This has been bugging me for three hours! I keep receiving the error:
File not found. Even though I have placed it in the correct location. I
have no idea why it is doing it as I feel it should be working.
Hi guys, thanks for all of your replies. After about 6 hours, I managed
to get it working by simply changing the way the File.open code was
being executed. Very very strange but glad its working now
Another possibility is that the relative file path being used in the
code is failing to find the intended file because the current working
directory of the script is not in the correct place. Try printing the
output of File.expand_path for the file path to see if it resolves to
the place you expect.
-Jeremy
···
On 01/16/2013 10:24 AM, Wayne Brisette wrote:
Adam:
Can anybody read the contents in that directory? Almost sounds like there is
some sort of read permissions error.