# Win32 service error

**URL:** <https://www.ruby-forum.com/t/win32-service-error/186749>\
**Category:** Ruby\
**Created:** [February 25, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/win32-service-error/186749 "2008-02-25T18:56:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [February 25, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/win32-service-error/186749/1 "2008-02-25T18:56:22Z")

</div>

Hello  
I am trying out an example from  
[http://rubyforge.org/docman/view.php/85/595/service.html](http://rubyforge.org/docman/view.php/85/595/service.html)  
and it errors out  
require “win32/service”  
include Win32

# Create a new service

Service.create(‘some\_service’, nil,  
:service\_type =\> Service::WIN32\_OWN\_PROCESS,  
:description =\> ‘A custom service I wrote just for fun’  
:start\_type =\> Service::AUTO\_START,  
:error\_control =\> Service::ERROR\_NORMAL,  
:binary\_path\_name =\> ‘E:\TradingTools\torontotrader  
\startServer.bat’,  
:load\_order\_group =\> nil,  
:dependencies =\> nil  
:service\_start\_name =\> ‘LocalSystem’,  
:password =\> nil,  
:display\_name =\> ‘This is some service’  
)

E:/TradingTools/Development/app/helpers/Ruby-1.rb:8: syntax error,  
unexpected tSYMBEG, expecting ‘)’  
:start\_type =\> Service::AUTO\_START,  
^

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [February 25, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/win32-service-error/186749/2 "2008-02-25T19:00:29Z")

</div>

Junkone wrote:

> ```
> :description => 'A custom service I wrote just for fun'
> :start_type => Service::AUTO_START,
> 
> ```

There’s a comma missing after “fun’”.

HTH,  
Sebastian

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [February 25, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/win32-service-error/186749/3 "2008-02-25T19:50:43Z")

</div>

On Feb 25, 12:59 pm, Sebastian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Jabber: removed\_email\_address@domain.invalid  
> ICQ: 205544826

thanks for pointing it out.  
i get new errors now.  
Is there anything that my executable should do in order to be a  
service. i have created services before with vb and have not  
experienced issues. bat file is a simple one having this statemetn.  
thin start -e production -p 3000

When i run it directly, it works. but i run it as part of the  
servicem, the start up fails with this error

This is some service service failed to start due to the following  
error:  
The service did not respond to the start or control request in a  
timely fashion.

My code for the service implementation is

require “win32/service”  
include Win32

# Create a new service

Service.create(‘some\_service’, nil,  
:service\_type =\> Service::WIN32\_OWN\_PROCESS,  
:description =\> ‘A custom service I wrote just for fun’,  
:start\_type =\> Service::AUTO\_START,  
:error\_control =\> Service::ERROR\_NORMAL,  
:binary\_path\_name =\> ‘E:\TradingTools\torontotrader  
\startServer.bat’,  
:load\_order\_group =\> nil,  
:dependencies =\> nil,  
:service\_start\_name =\> ‘LocalSystem’,  
:password =\> nil,  
:display\_name =\> ‘This is some service’  
)
