 |
Forums |
Admin Start New Thread
By: Dan Rathbun
RE: require 'Win32API' [ reply ] 2009-11-12 04:46
|
Error:
"..../ruby/lib/ruby/gems/1.8/gems/win32-clipboard-0.4.3/lib/win32/clipboard.rb:25: uninitialized constant Win32::Clipboard::Win32API (NameError)"
* Note the exact case, ie: "Win32API"
Tracing it backward:
win32/clipboard.rb:25 = "include Windows::Window::Message"
windows/window/message.rb:1 = "require 'windows/api'"
windows/api.rb:1 = "require 'win32/api'"
[this would NOT be the error as it's lowercase and would not produce an 'unintialized constant' error, but besides... it's a quoted string and we don't require constants.]
NONE of the above files have the string 'Win32API' in the latest versions.
YOUR win32/api.c DOES have string (typedef struct) 'Win32API'
HOWEVER, the ruby 1.8 branch ALSO had the code for Win32API.c
in the folder,ie: lib/ext/Win32API/Win32API.c
which is also full of references to a typedef struct Win32API as it's purpose is to create the Class Win32API
(but it's parameters are slightly different from those in your in api.c)
..
IF for some reason, the class is not defined in Ruby.. and a reference is made to a name beginning with a capital letter, and no class matches, Ruby thinks it's supposed to be a Constant, so we get an undefined Constant Error.
I have this week, had errors with the old ver 1.8.6 Win32API.so, that give me Windows error 127: Proc not found, with a message 'Unable to find Init_Win32API', which is the last function in the source that creates the Win32API class.
I didn't realize I had the 1.8.7 ver until this eve, so I'm going to replace the 1.8.6 ver and see if perhaps that was the problem.
And of course, in 1.9.x the Win32API.c is replaced with a Win32API.rb translator to the DL module.
|
By: Dan Rathbun
RE: require 'Win32API' [ reply ] 2009-11-12 01:00
|
On the blogspot, the 'poster', Ashish Chatterjee said:
"a small bug/update needed...
the code snippet for ruby2html should now be
require 'syntax/convertors/html'
<bold>require 'Win32API'</bold>
require 'win32/clipboard'
include Win32
...
...
...
as without including that line you get an error like
"..../ruby/lib/ruby/gems/1.8/gems/win32-clipboard-0.4.3/lib/win32/clipboard.rb:25: uninitialized constant Win32::Clipboard::Win32API (NameError)"
I searched thru that file in win32-clipboard-0.5.2 and the string "WIN32API" is not found in the newer file.
Musta been a typo in ver 0.4.3 ?
|
By: David Wilcock
RE: require 'Win32API' [ reply ] 2009-04-20 09:58
|
Hi Dan,
It did this with 0.4.3 installed via the windows one click installer package.
I just tried installing it with gem and this was no longer needed. (I did have to do some digging to work out which platform options to use btw).
Thanks,
David
|
By: Daniel Berger
RE: require 'Win32API' [ reply ] 2009-04-15 20:48
|
Hi David,
That should not be necessary. What version of win32-clipboard are you using? The gemspec already requires windows-pr, which in turn requires win32-api.
Regards,
Dan
|
|
 |