dubstep
1
I downloaded and installed the Ruby Gem called
win32screenshot-1.0.2.gem. I installed it by typing the following:
gem install win32screenshot
It seemed to install fine. However, when I run the program I get the
following error:
internal:lib/rubygems/custom_require:29:in `require’: no such file to
load – win32/screenshot (LoadError)
Here is my program:
require ‘win32/screenshot’
count = 0
while count != 10
count = count+1
Win32::Screenshot::Take.of(:foreground).write(“c:\scrn_cap” +
count.to_s() + “.jpg”)
sleep(600)
end
bobh
2
On Friday, February 11, 2011 at 4:55 PM, Bob H. wrote:
require ‘win32/screenshot’
end
You probably need to require RubyGems first.
require ‘rubygems’
require ‘win32/screenshot’
count = 0
while count != 10
count = count+1
Win32::Screenshot::Take.of(:foreground).write(“c:\scrn_cap” +
count.to_s() + “.jpg”)
sleep(600)
end
If you don’t want to explicitly require RubyGems then you can specify it
in RUBYOPT. See the post-install instructions here:
http://docs.rubygems.org/read/chapter/3
bobh
3
On Feb 11, 8:55pm, Bob H. [email protected] wrote:
What version of Ruby? how you know it installed fine? Does it shows on
“gem list win32” ?
What is the result of the following:
ruby -v -e “require ‘rubygems’; require ‘win32/screenshot’”
bobh
4
On Friday, February 11, 2011 at 4:55 PM, Bob H. wrote:
internal:lib/rubygems/custom_require:29:in `require’: no such file to
load – win32/screenshot (LoadError)
Ah, ignore my earlier message. I skipped right over this which shows
RubyGems in the mix. Apologies.
bobh
5
On Feb 11, 6:11pm, Luis L. [email protected] wrote:
internal:lib/rubygems/custom_require:29:in `require’: no such file to
Luis L.
hi pleases, s.o.s baby steps
bobh
6
require ‘win32/screenshot’"
bobh
7
On Feb 11, 2011, at 15:55 , Bob H. wrote:
count = 0
while count != 10
count = count+1
Might I suggest:
10.times do |n|
look! I’m indented!
Win32::Screenshot::Take.of(:foreground).write
“c:\scrn_cap#{count}.jpg”
sleep 600
end