Not finding a Ruby Gem

B

Bob Hatch

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
 
M

Mike Moore

[Note: parts of this message were removed to make it a legal post.]

On Friday, February 11, 2011 at 4:55 PM, Bob Hatch wrote:
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
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
 
L

Luis Lavena

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)

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'"
 
M

Mike Moore

[Note: parts of this message were removed to make it a legal post.]

On Friday, February 11, 2011 at 4:55 PM, Bob Hatch wrote:
load -- win32/screenshot (LoadError)
Ah, ignore my earlier message. I skipped right over this which shows RubyGems in the mix. Apologies.
 
R

Ryan Davis

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
 
6

60636

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'"

hi pleases, s.o.s baby steps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top