Forum: Ruby Installation of Win32-service module

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.
Jatinder S. (Guest)
on 2006-06-07 07:37
(Received via mailing list)
Hi,


I intend to use Win32-service module to perform some operations with
Windows
services.

I downloaded win32-service-0.5.0 from Rubyforge and referring README,
when I
try to install this module by issuing "ruby extconf.rb" which results in
following messages on console,

checking for EnumServicesStatusEx()... no
checking for QueryServiceStatusEx()... no
creating Makefile
mkmf.log file gets generated with following contents,
have_func: checking for EnumServicesStatusEx()... --------------------
no

"cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib
advapi32.lib wsock32.lib -link -libpath:"D:/ruby/lib" -stack:0x2000000"
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { EnumServicesStatusEx(); return 0; }
/* end */

"cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib
advapi32.lib wsock32.lib -link -libpath:"D:/ruby/lib" -stack:0x2000000"
checked program was:
/* begin */
#include <windows.h>
#include <winsock.h>

/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void
((*)()))EnumServicesStatusEx;
return 0; }
/* end */

--------------------

have_func: checking for QueryServiceStatusEx()... --------------------
no

"cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib
advapi32.lib wsock32.lib -link -libpath:"D:/ruby/lib" -stack:0x2000000"
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { QueryServiceStatusEx(); return 0; }
/* end */

"cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib
advapi32.lib wsock32.lib -link -libpath:"D:/ruby/lib" -stack:0x2000000"
checked program was:
/* begin */
#include <windows.h>
#include <winsock.h>

/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void
((*)()))QueryServiceStatusEx;
return 0; }
/* end */

--------------------

I verified by running daemon_test.rb program that Win32-service was not
installed.
I have ruby 1.8.4(2005-12-24) installed on my machine.

Please help me out with the above issue.

Thanks in Advance,
Jatinder
Park H. (Guest)
on 2006-06-07 08:45
(Received via mailing list)
Hi,

>Windows
>services.
>
>I downloaded win32-service-0.5.0 from Rubyforge and referring README, when
>I
>try to install this module by issuing "ruby extconf.rb" which results in
>following messages on console,
>
>checking for EnumServicesStatusEx()... no
>checking for QueryServiceStatusEx()... no
>creating Makefile
<snip>
>

Above is normal message for Visual C++ 6.0.
EnumServicesStatusEx and QueryServiceStatusEx added for Visual C++ 7.0
or
higher.

>
>I verified by running daemon_test.rb program that Win32-service was not
>installed.

After "ruby extconf.rb"
You must run "nmake install" to complete installation.
Then verify by running deamon_test.rb

Regards,

Park H.
Jatinder S. (Guest)
on 2006-06-07 16:30
(Received via mailing list)
Hi Park,

I get following error message when I run "nmake install",

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

        D:\ruby\bin\ruby -e "puts 'EXPORTS', 'Init_service'"  >
service-i386-msw
in32.def
        cl -nologo -MD -Zi -O2b2xg- -G6 -I.
-ID:/ruby/lib/ruby/1.8/i386-mswin32
-ID:/ruby/lib/ruby/1.8/i386-mswin32 -I. -c -Tcservice.c
'cl' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code
'0x1'
Stop.
after running nmake i confirmed that win32-service has not been
installed.

your help is appreciated.

Regards,
Jatinder
Jatinder S. (Guest)
on 2006-06-07 16:36
(Received via mailing list)
I understand that "Cl" is the MSVC++ command line compiler, which looks
like
is not installed on my pc. is this a pre-requisite for using
win32-service
module?

I downloaded InstantRails which provides ruby,rails, apache and mysql; I
found that the ruby provided by InstantRails comes with win32-service
module, I tried using it by running daemon_test.rb and bingo, it ran
fine.

Now I dont want to depend on InstantRails, instead I would like to
install
win32-service module in a version of ruby which does not have
win32-service
module; for that do I need to have MS VC++, nmake utility on my machine?

Thanks and Regards
Jatinder
Park H. (Guest)
on 2006-06-07 17:31
(Received via mailing list)
Hi,

>
>I downloaded InstantRails which provides ruby,rails, apache and mysql; I
>found that the ruby provided by InstantRails comes with win32-service
>module, I tried using it by running daemon_test.rb and bingo, it ran fine.
>
>Now I dont want to depend on InstantRails, instead I would like to install
>win32-service module in a version of ruby which does not have win32-service
>module; for that do I need to have MS VC++, nmake utility on my machine?
>
You can download compiled binary file "service.so" at
http://home.nownuri.net/~phasis/service.so

Copy "service.so" to "\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\win32"
folder.


Regards,

Park H.
Jatinder S. (Guest)
on 2006-06-07 19:52
(Received via mailing list)
Thanks Park!
I am able to use win32-service module after copying service.so file to
mentioned location.

-Jatinder
This topic is locked and can not be replied to.