uninitialized constant Windows::API::Error (NameError)

702 views
Skip to first unread message

Dennis I.

unread,
Mar 30, 2009, 11:22:21 AM3/30/09
to Watir General
I tried installing Watir at home a while ago and kept getting an
error. I followed some instructions here from a different discussion
that mentioned installing and reinstalling some gems.
That didn't work. And today I tried again. Here is the error that I
get.

>ruby test.rb
C:/Ruby/lib/ruby/gems/1.8/gems/windows-pr-0.9.3/lib/windows/thread.rb:
59: uninitialized constant Windows::API::Error (NameError)
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/gems/1.8/gems/win32-process-0.5.9/lib/win32/
process.rb:3
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
process.rb:1
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:45
from test.rb:22
Test executed on Mon Mar 30 12:14:05 -0300 2009

Here is the code until where it gets stuck:

require 'watir'

time = Time.now.to_s
puts "Test executed on "+time

test_site = "http://www.google.com"

ie = Watir::IE.open(test_site) # this is line 22

IDIEININIIS

unread,
Mar 30, 2009, 11:25:09 AM3/30/09
to Watir General
Some more details:

ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]

gem list -l watir
watir (1.6.2)

Al Snow

unread,
Mar 30, 2009, 11:27:08 AM3/30/09
to watir-...@googlegroups.com
Check this out: http://groups.google.com/group/watir-general/browse_thread/thread/94b030306ba86225

Thanks,
Al Snow
Linkedin: http://www.linkedin.com/in/alsnow
Google Talk: jasnow1
Twitter: jasnow

> Date: Mon, 30 Mar 2009 08:25:09 -0700
> Subject: [wtr-general] Re: uninitialized constant Windows::API::Error (NameError)
> From: ideler...@gmail.com
> To: watir-...@googlegroups.com

frank.li

unread,
Apr 7, 2009, 4:13:26 AM4/7/09
to Watir General
This issue is windows-pr version
resolution:
Gem uninstall windows-pr
Gem install windows-pr

answer from http://www.zhuaijun.cn/archives/53

satish

unread,
Apr 7, 2009, 9:48:48 AM4/7/09
to Watir General
That is correct. I ran into same issue and got it resolved with same
command.
> > ie = Watir::IE.open(test_site) # this is line 22- Hide quoted text -
>
> - Show quoted text -

marekj

unread,
Apr 8, 2009, 6:07:12 PM4/8/09
to Watir General
Had the same issue on Windows XP test machine here when upgrading
framework to use watir 1.6.2 and Ruby 1.8.6-26
We had windows-pr-0.9.6.gem installed with watir 1.6.2

I upgraded to following gems and it's fine
windows-pr-1.0.2
windows-api-0.3.0.gem
win32-api-1.4.0-x86-mswin32-60.gem

fyi: We maintain a private cache of gems here so I can prepackage
installation on our test machines here with rake tasks

karimnumerouno

unread,
May 1, 2009, 4:41:55 AM5/1/09
to Watir General
this is the solution

perform
gem install win32-api --platform x86-mswin32-60

and then

gem install windows-pr

performing the above steps worked for me
Reply all
Reply to author
Forward
0 new messages