# Newbie: Strange error when playing with the UserEngine

**URL:** <https://www.ruby-forum.com/t/newbie-strange-error-when-playing-with-the-userengine/55484>\
**Category:** Engines\
**Created:** [March 21, 2006, 4:17pm UTC](https://www.ruby-forum.com/t/newbie-strange-error-when-playing-with-the-userengine/55484 "2006-03-21T16:17:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_van\_Doorn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@Jeroen\_van\_Doorn](https://www.ruby-forum.com/u/Jeroen_van_Doorn)\
**Post date:** [March 21, 2006, 4:17pm UTC](https://www.ruby-forum.com/t/newbie-strange-error-when-playing-with-the-userengine/55484/1 "2006-03-21T16:17:34Z")

</div>

Hi All,

When playing with the user engine, I’ve encountered the following.

When I want to “register for an account” everything goes ok…  
But when I want to activate the account I end in an everlasting loop.

I’ve found that the code in the function “add\_user\_role” doesn’t work  
properly, though  
when I set :user\_role\_name to another name I do get an error in my  
development log …

Any hints?

Kind regards,  
Jeroen van Doorn

---

<div class="post-metadata">

**Author:** ![Jeroen\_van\_Doorn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@Jeroen\_van\_Doorn](https://www.ruby-forum.com/u/Jeroen_van_Doorn)\
**Post date:** [March 24, 2006, 10:34am UTC](https://www.ruby-forum.com/t/newbie-strange-error-when-playing-with-the-userengine/55484/2 "2006-03-24T10:34:50Z")

</div>

Sorry for the late reply,

Don’t have any strange chars in my url, I’ve made a new test app and  
there it works ok …  
As soon as I’ve found the error (probably my own mistake), I’ll report  
what is was.

Regards,  
Jeroen

---

<div class="post-metadata">

**Author:** ![Jeroen\_van\_Doorn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@Jeroen\_van\_Doorn](https://www.ruby-forum.com/u/Jeroen_van_Doorn)\
**Post date:** [March 22, 2006, 4:31pm UTC](https://www.ruby-forum.com/t/newbie-strange-error-when-playing-with-the-userengine/55484/3 "2006-03-22T16:31:55Z")

</div>

Sorry to sound like I think everyone is running into the same bug, are  
there by any chance any punctuation characters like hyphens in your  
application’s root path? For example /usr/local/rails-stuff/appname …?

If that’s the case, there’s a one-line fix to a file in the Engines  
plugin that solves this, and it’s just been fixed in the trunk, but not  
in any of the release versions yet.

Jeroen van Doorn wrote:

> Hi All,
> 
> When playing with the user engine, I’ve encountered the following.
> 
> When I want to “register for an account” everything goes ok…  
> But when I want to activate the account I end in an everlasting loop.
> 
> I’ve found that the code in the function “add\_user\_role” doesn’t work  
> properly, though  
> when I set :user\_role\_name to another name I do get an error in my  
> development log …
> 
> Any hints?
> 
> Kind regards,  
> Jeroen van Doorn

---

<div class="post-metadata">

**Author:** ![Jeroen\_van\_Doorn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@Jeroen\_van\_Doorn](https://www.ruby-forum.com/u/Jeroen_van_Doorn)\
**Post date:** [March 24, 2006, 11:37am UTC](https://www.ruby-forum.com/t/newbie-strange-error-when-playing-with-the-userengine/55484/4 "2006-03-24T11:37:03Z")

</div>

Well … found it, but I’m not proud :S

In the user model I added a has\_many relation …  
This isn’t a problem, only I added it before the includes

include LoginEngine::AuthenticatedUser  
include UserEngine::AuthorizedUser

Never gonna make this mistake again…

Regards,  
Jeroen

---

<div class="post-metadata">

**Author:** ![Jeroen\_van\_Doorn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@Jeroen\_van\_Doorn](https://www.ruby-forum.com/u/Jeroen_van_Doorn)\
**Post date:** [March 24, 2006, 11:06am UTC](https://www.ruby-forum.com/t/newbie-strange-error-when-playing-with-the-userengine/55484/5 "2006-03-24T11:06:23Z")

</div>

It’s really strange …

The Code for both installations is the same …  
The Database names (en content for the system roles) are the same  
They are even running on the same server.

Program1 gets in an infinite loop, Program2 doesn’t

Shoot me!
