User_engine installation problem

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.

Have you by chance turned off pluralization?

-nb

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

On 1/29/06, Bruce R. [email protected] 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

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.” [email protected]
To: “Discussion of the use of existing Engines”
[email protected]
Sent: Monday, January 30, 2006 4:48 AM
Subject: Re: [Engine-users] user_engine installation problem

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

  • james

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

On 1/30/06, James A. [email protected] 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
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~

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