Using new FileFind

  • Follow


Hi,
I'm running Ruby version1.9.3 over WinXP/SP3.
I ran "K:\>gem install file-find" in a Window Command window.
In response, I got (among other things):
  Successfully installed win32-api-1.4.8-x86-mingw32
  Successfully installed windows-api-0.4.2
  Successfully installed windows-pr-1.2.2
  Successfully installed win32-security-0.1.3
  Successfully installed sys-admin-1.5.6-x86-mingw32
  Successfully installed file-find-0.3.5
  6 gems installed
Using the rdoc/README.html at:
  K:/_Utilities/Ruby_1.9.3_p194/lib/ruby/gems/1.9.1/doc/file-find-0.3.5/
Based on the README, I ran the following Ruby program:

# FileFindGem_Test.rb
# K:\___RubyTopApps\Search\Example_07_Gem_FileFind\FileFindGem_Test.rb

puts "Ruby version" + RUBY_VERSION
STDOUT.flush

require 'file/find'

rule = File::Find.new(
  :pattern => "*.rb",
  :follow  => false,
  :path    => ['/usr/local/lib', '/opt/local/lib']
)

rule.find{ |f|
  puts f
}

and got the following:
K:\>ruby K:\___RubyTopApps\Search\Example_07_Gem_FileFind\FileFindGem_Test.rb
Ruby version1.9.3
K:/_Utilities/Ruby_1.9.3_p194/lib/ruby/gems/1.9.1/gems/file-find-0.3.5/lib
   /file /find.rb:229:in `open': no::ENOENT)
	from K:/_Utilities/Ruby_1.9.3_p194/lib/ruby/gems/1.9.1/gems/file-find-0.3.5/lib/file/find.rb:229:in `foreach'
	from K:/_Utilities/Ruby_1.9.3_p194/lib/ruby/gems/1.9.1/gems/file-find-0.3.5/lib/file/find.rb:229:in `block in find'
	from K:/_Utilities/Ruby_1.9.3_p194/lib/ruby/gems/1.9.1/gems/file-find-0.3.5/lib/file/find.rb:227:in `each'
	from K:/_Utilities/Ruby_1.9.3_p194/lib/ruby/gems/1.9.1/gems/file-find-0.3.5/lib/file/find.rb:227:in `find'
	from FileFindGem_Test.rb:15:in `<main>'

I don't feel competent to debug FileFind.  Anybody got any idea about what's wrong.

Thanks in Advance,
Richard
0
Reply RichardDummyMailbox58407 (349) 7/26/2012 8:27:15 PM


0 Replies
61 Views

(page loaded in 0.022 seconds)


Reply: