# Problems with mongrel\_service and used account

**URL:** <https://www.ruby-forum.com/t/problems-with-mongrel-service-and-used-account/179005>\
**Category:** Mongrel\
**Created:** [November 15, 2009, 2:01pm UTC](https://www.ruby-forum.com/t/problems-with-mongrel-service-and-used-account/179005 "2009-11-15T14:01:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [November 15, 2009, 2:01pm UTC](https://www.ruby-forum.com/t/problems-with-mongrel-service-and-used-account/179005/1 "2009-11-15T14:01:31Z")

</div>

Hi everybody,

I try to use in a rails application that is installed with  
mongrel\_service  
on windows the win32ole API to access Outlook appointments. This works  
well when started from the command line, but does not work when started  
as  
a service.

What should I check in which order to trap down the error?

Bye  
Markus

---

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [November 15, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/problems-with-mongrel-service-and-used-account/179005/2 "2009-11-15T23:32:42Z")

</div>

On Sun, Nov 15, 2009 at 9:21 AM, Markus L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi everybody,
> 
> I try to use in a rails application that is installed with mongrel\_service  
> on windows the win32ole API to access Outlook appointments. This works  
> well when started from the command line, but does not work when started as  
> a service.
> 
> What should I check in which order to trap down the error?

Hello Markus,

Services run without privileges for certain things, like create  
objects and such.

Since you’re executing from the command line and work, means that your  
user has access to these OLE objects.

There are two options:

1. Configure the service to run under the same user account (that can  
be done from the services management interface)

2. Determine the issue using psexec.

Try to lower the privileges of the prompt and execute the exact same  
command line.

The tools you need are psexec, as I mentioned here:

[http://rubyforge.org/pipermail/mongrel-users/2007-February/003006.html](http://rubyforge.org/pipermail/mongrel-users/2007-February/003006.html)

See that thread for details.

Please also include in your reply information about your OS (32bits or  
64bits), versions of Ruby and the gems installed too.

There is a known issue with 64bits Windows that was solved in latest  
gem release, just in case.

## Cheers,

## Luis L. AREA 17

Perfection in design is achieved not when there is nothing more to add,  
but rather when there is nothing more to take away.  
Antoine de Saint-Exupéry

---

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [November 21, 2009, 10:25am UTC](https://www.ruby-forum.com/t/problems-with-mongrel-service-and-used-account/179005/3 "2009-11-21T10:25:59Z")

</div>

Hi Luis,

On Sun, 15 Nov 2009 23:32:02 +0100, Luis L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > What should I check in which order to trap down the error?  
> > There are two options:
> 
> 1. Configure the service to run under the same user account (that can  
> be done from the services management interface)

I just tried that. See my question on Stackoverflow  
([http://stackoverflow.com/questions/1737135/error-when-reading-outlook-calendar-from-rails-application-when-started-as-a-mong](http://stackoverflow.com/questions/1737135/error-when-reading-outlook-calendar-from-rails-application-when-started-as-a-mong))  
and the hint of Mr. Doggen that this may not work with Outlook.

I have tested it again with the correct user account and it did not work  
either. So I found the workaround:

Start a small script like

ruby script\runner ‘AppointmentController.new.refresh\_no\_redirect’

> 1. Determine the issue using psexec.
> 
> Try to lower the privileges of the prompt and execute the exact same  
> command line.
> 
> The tools you need are psexec, as I mentioned here:
> 
> [http://rubyforge.org/pipermail/mongrel-users/2007-February/003006.html](http://rubyforge.org/pipermail/mongrel-users/2007-February/003006.html)
> 
> See that thread for details.

I did not tried that, thank’s anyway for the recommendation.

> Please also include in your reply information about your OS (32bits or  
> 64bits), versions of Ruby and the gems installed too.

Well, I don’t think that they matter here. I use Windows XP (32bit),  
ruby  
1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

> There is a known issue with 64bits Windows that was solved in latest  
> gem release, just in case.
> 
> Cheers,

Thank’s a lot for your hints.

Bye  
Markus
