# User\_engine installation problem

**URL:** <https://www.ruby-forum.com/t/user-engine-installation-problem/53215>\
**Category:** Engines\
**Created:** [January 29, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215 "2006-01-29T13:22:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brucer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@brucer](https://www.ruby-forum.com/u/brucer)\
**Post date:** [January 29, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215/1 "2006-01-29T13:22:46Z")

</div>

Hello All,

I am trying to install user\_engine, but am unable to get the rake  
commands to work.

For example, when I run rake bootstrap I get the following error:

rake aborted!  
PGError: ERROR: relation “permission” does not exist  
: SELECT a.attname, format\_type(a.atttypid, a.atttypmod),  
d.adsrc, a  
.attnotnull  
FROM pg\_attribute a LEFT JOIN pg\_attrdef d  
ON a.attrelid = d.adrelid AND a.attnum = d.adnum  
WHERE a.attrelid = ‘permission’::regclass  
AND a.attnum \> 0 AND NOT a.attisdropped  
ORDER BY a.attnum

I know that there is no table called “permission” because the table is  
called “permission\_table” as specified in the Permission model class:

class Permission \< ActiveRecord::Base

set\_table\_name UserEngine.config(:permission\_table)  
has\_and\_belongs\_to\_many :roles, :join\_table =\>  
UserEngine.config(:permission\_role\_table)

Can anyone throw any light on this?

I am using Rails 1.0, PostgreSQL 8.0.3, and Windows XP.

Many thanks,  
Bruce.

---

<div class="post-metadata">

**Author:** ![brucer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@brucer](https://www.ruby-forum.com/u/brucer)\
**Post date:** [January 29, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215/2 "2006-01-29T21:44:53Z")

</div>

Have you by chance turned off pluralization?

-nb

```auto
 Nathaniel S. H. Brown http://nshb.net

```

---

<div class="post-metadata">

**Author:** ![brucer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@brucer](https://www.ruby-forum.com/u/brucer)\
**Post date:** [January 29, 2006, 9:50pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215/3 "2006-01-29T21:50:55Z")

</div>

On 1/29/06, Bruce R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I know that there is no table called “permission” because the table is  
> called “permission\_table” as specified in the Permission model class:
> 
> class Permission \< ActiveRecord::Base
> 
> set\_table\_name UserEngine.config(:permission\_table)

This doesn’t mean the table is actually called “permission\_table”;  
rather that it uses the value stored in the CONFIG for the UserEngine  
with the key :permission\_table. The defaults are ‘permission’ or  
‘permissions’ (depending on whether or not you’ve turned on  
pluralisation. Unless, of course, you’ve set this explicitly - it  
wasn’t clear in your post.

Assuming that you didn’t specify any custom table names, what tables  
do you have in your database?

- james

---

<div class="post-metadata">

**Author:** ![brucer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@brucer](https://www.ruby-forum.com/u/brucer)\
**Post date:** [January 30, 2006, 12:35pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215/4 "2006-01-30T12:35:08Z")

</div>

Hello James,

Thanks for the post.

I was unable to get the migrate scripts to work and therefore created  
the  
tables by hand. However being new to Ruby and Rails I mistakenly thought  
that the table was called permission\_table not permission or permissions  
and  
set the table up accordingly.

I guess I should have asked for input on why I couldn’t get the migrate  
scripts to work, so I will ask that now.

I tried to set up the database by running “rake engine\_migrate  
ENGINE=login”  
and “rake engine\_migrate ENGINE=user” from the root directory of my  
project,  
but received the following output:

Microsoft Windows XP [Version 5.1.2600]  
(C) Copyright 1985-2001 Microsoft Corp.

C:\radrails-projects\PhicorpBooking\>rake engine\_migrate ENGINE=login  
(in C:/radrails-projects/PhicorpBooking)  
The db/migrate directory for engine ‘login\_engine’ appears to be  
missing.  
Should be:  
C:/radrails-projects/PhicorpBooking/config/…/C:/radrails-projects/Ph  
icorpBooking/config/…/vendor/plugins/login\_engine/db/migrate

C:\radrails-projects\PhicorpBooking\>rake engine\_migrate ENGINE=user  
(in C:/radrails-projects/PhicorpBooking)  
The db/migrate directory for engine ‘user\_engine’ appears to be missing.  
Should be:  
C:/radrails-projects/PhicorpBooking/config/…/C:/radrails-projects/Ph  
icorpBooking/config/…/vendor/plugins/user\_engine/db/migrate

Could you tell me why I received the above output, and how the schema.rb  
file in db directory is used (I have done nothing with the two schema.rb  
files)?

Many thanks,  
Bruce.

----- Original Message -----  
From: “James A.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: “Discussion of the use of existing Engines”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Monday, January 30, 2006 4:48 AM  
Subject: Re: [Engine-users] user\_engine installation problem

---

<div class="post-metadata">

**Author:** ![brucer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@brucer](https://www.ruby-forum.com/u/brucer)\
**Post date:** [January 30, 2006, 12:44pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215/5 "2006-01-30T12:44:46Z")

</div>

Hi Bruce,

The problem is described here, and a release including this fix will  
be forthcoming in the next few days:  
[https://opensvn.csie.org/traccgi/rails\_engines/trac.cgi/ticket/61](https://opensvn.csie.org/traccgi/rails_engines/trac.cgi/ticket/61)

- james

---

<div class="post-metadata">

**Author:** ![brucer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@brucer](https://www.ruby-forum.com/u/brucer)\
**Post date:** [February 3, 2006, 12:35pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215/6 "2006-02-03T12:35:05Z")

</div>

This bug is now fixed and available in the Engines plugin 1.0.6

On 1/30/06, James A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I tried to set up the database by running “rake engine\_migrate ENGINE=login”  
> > C:/radrails-projects/PhicorpBooking/config/…/C:/radrails-projects/Ph  
> > file in db directory is used (I have done nothing with the two schema.rb  
> > Sent: Monday, January 30, 2006 4:48 AM
> > 
> > > - james  
> > > 27/01/2006
> > 
> > * * *
> > 
> > engine-users mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

–

- J \*  
~

---

<div class="post-metadata">

**Author:** ![brucer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e4f/32.png) [@brucer](https://www.ruby-forum.com/u/brucer)\
**Post date:** [January 30, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/user-engine-installation-problem/53215/7 "2006-01-30T12:41:36Z")

</div>

> Could you tell me why I received the above output, and how the schema.rb  
> file in db directory is used (I have done nothing with the two schema.rb  
> files)?

This is a bug in Engine’s rake file, which mistakenly adds two  
RAILS\_ROOT to the path (as you can see).

Piotr
