Forum: Rails Engines user_engine installation problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bruce R. (Guest)
on 2006-01-29 14:22
(Received via mailing list)
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.
Nshbrown N. (Guest)
on 2006-01-29 22:44
(Received via mailing list)
Have you by chance turned off pluralization?

-nb


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Nathaniel S. H. Brown                           http://nshb.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
James A. (Guest)
on 2006-01-29 22:50
(Received via mailing list)
On 1/29/06, Bruce R. <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
Bruce R. (Guest)
on 2006-01-30 13:35
(Received via mailing list)
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>
To: "Discussion of the use of existing Engines"
<removed_email_address@domain.invalid>
Sent: Monday, January 30, 2006 4:48 AM
Subject: Re: [Engine-users] user_engine installation problem
Piotr U. (Guest)
on 2006-01-30 13:41
(Received via mailing list)
> 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
James A. (Guest)
on 2006-01-30 13:44
(Received via mailing list)
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/tra...

- james
James A. (Guest)
on 2006-02-03 13:35
(Received via mailing list)
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> 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...
> >
>


--
* J *
  ~
This topic is locked and can not be replied to.