From: David Beckwith Date: 2008-10-01T17:29:36+09:00 Subject: Re: Mechanize error, File doesn't exist -- but it DOES! Here is basically what's running in the script: file_path = "web20_logos/" + "evenspacer.gif" puts "rel path: " + file_path puts "exists?: " + File.exists?( file_path ).to_s puts "expanded path: " + File.expand_path( file_path ) puts "exists?: " + File.exists?( File.expand_path( file_path ) ).to_s yields: exists?: false expanded path: /Users/dbit/Sites/fuseme/fuseme_rails/app/models/scrapers/web20/web20_logos/evenspacer.gif exists?: false /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize/form.rb:294:in `initialize': No such file or directory - /Users/dbit/Sites/fuseme/fuseme_rails/app/models/scrapers/web20/web20_logos/evenspacer.gif (Errno::ENOENT) from /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize/form.rb:294:in `open' from /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize/form.rb:294:in `file_to_multipart' from /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize/form.rb:200:in `request_data' from /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize/form.rb:200:in `each' from /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize/form.rb:200:in `request_data' from /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize.rb:380:in `post_form' from /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.8.3/lib/www/mechanize.rb:324:in `submit' from web20.rb:47:in `submit_new_thing' from web20.rb:90 But when I type it at the command line: ruby -e 'puts (File.exist? "web20_logos/evenspacer.gif").to_s' # It yields true.... Very weird. -- Posted via http://www.ruby-forum.com/.