Forum: Ruby win32api

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Corey K. (Guest)
on 2006-05-13 11:33
hello

does this mean i dont have the WIN32API

irb(main):008:0> require 'win32api'
LoadError: 127: The specified procedure could not be found.   -
Init_win32api
C:/ruby/lib/ruby/1.8/i386-mswin32/win32api.so
	from C:/ruby/lib/ruby/1.8/i386-mswin32/win32api.so
	from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
	from (irb):8
	from :0


how do i get that or use it in a program?
Daniel B. (Guest)
on 2006-05-13 11:46
(Received via mailing list)
corey konrad wrote:
> hello
>
> does this mean i dont have the WIN32API
>
> irb(main):008:0> require 'win32api'

Try require 'Win32API'

Regards,

Dan
Corey K. (Guest)
on 2006-05-13 11:55
oh ok thanks thats right because Win32API is a class so it has to be
capatalized, kind of jumping ahead of myself there but i was just
curious.

Thanks




Daniel B. wrote:
> corey konrad wrote:
>> hello
>>
>> does this mean i dont have the WIN32API
>>
>> irb(main):008:0> require 'win32api'
>
> Try require 'Win32API'
>
> Regards,
>
> Dan
Dave B. (Guest)
on 2006-05-13 15:33
(Received via mailing list)
corey konrad wrote:
> oh ok thanks thats right because Win32API is a class so it has to be
> capatalized, kind of jumping ahead of myself there but i was just
> curious.

No, it's not a class, it's a required file. The case has to match method
name Init_...

irb(main):001:0> require 'wIn32ApI'
LoadError: 127: The specified procedure could not be found.   -
Init_wIn32ApI

Most libraries use all lowercase. Another one that trips people up is
"RMagick". "Win32API" is the only one with uppercase letters in the
standard library, as you can see from the list at
http://www.ruby-doc.org/stdlib/

Cheers,
Dave
Corey K. (Guest)
on 2006-05-14 03:36
oh ok thanks for the info, i jus started ruby like a week ago, but
playing around with th e wind32api or doing shell stuff in linux are
probably he first thing i am going to do to get more comfortable with
programming. I think that it would make sence to play around with as
many classes and methods as i can first before writing my own. Do you
think that is a good plan?





Dave B. wrote:
> corey konrad wrote:
>> oh ok thanks thats right because Win32API is a class so it has to be
>> capatalized, kind of jumping ahead of myself there but i was just
>> curious.
>
> No, it's not a class, it's a required file. The case has to match method
> name Init_...
>
> irb(main):001:0> require 'wIn32ApI'
> LoadError: 127: The specified procedure could not be found.   -
> Init_wIn32ApI
>
> Most libraries use all lowercase. Another one that trips people up is
> "RMagick". "Win32API" is the only one with uppercase letters in the
> standard library, as you can see from the list at
> http://www.ruby-doc.org/stdlib/
>
> Cheers,
> Dave
Dave B. (Guest)
on 2006-05-14 06:06
(Received via mailing list)
corey konrad wrote:
> oh ok thanks for the info, i jus started ruby like a week ago, but
> playing around with th e wind32api or doing shell stuff in linux are
> probably he first thing i am going to do to get more comfortable with
> programming. I think that it would make sence to play around with as
> many classes and methods as i can first before writing my own. Do you
> think that is a good plan?

Not really. It's not a bad idea, but it's just so easy making classes in
Ruby, so you might be able to just jump straight into it.

Chapters 11-17 of Matz' Ruby U.'s Guide might be of some help with the
concepts involved.
http://www.ruby-doc.org/docs/UsersGuide/rg/

Cheers,
Dave
This topic is locked and can not be replied to.