# ACTIVE\_BRAC engine migration error

**URL:** <https://www.ruby-forum.com/t/active-brac-engine-migration-error/95806>\
**Category:** Rails\
**Created:** [June 14, 2006, 5:09am UTC](https://www.ruby-forum.com/t/active-brac-engine-migration-error/95806 "2006-06-14T05:09:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [June 14, 2006, 5:09am UTC](https://www.ruby-forum.com/t/active-brac-engine-migration-error/95806/1 "2006-06-14T05:09:11Z")

</div>

Hello Keegan,

You may already have forgotten about your posting from last month - but  
I  
stumbled across the EXACT same error today, and figured out a way around  
it.

The difficulty stems from you running under Windows XP, probably running  
InstantRails, right?

I fairly quickly discovered that the reason things were not working  
according to the ActiveRBAC Manual was that  
the code for ActiveRBAC assumes that you are running under a LINUX  
system

- or at least your file system follows  
the LINUX convention of /dir/some\_other\_dir/something\_else/foo/bar…

The offending code (at least so far for me) is a routine named realpath  
in  
the file  
InstantRails\ruby\lib\ruby\1.8\pathname.rb

Since I am running InstantRails under Windows XP, I had to find a way  
around this issue to continue with  
exploring ActiveRBAC.

I eventually got around this issue, but not by using the “rake  
db:migrate:engines” command.

I have uploaded a batch file and 9 other supporting files in a ZIP file  
attached to this message.

You need to:

- download the ZIP file,

- unzip the contents into the application directory for which you are  
trying to place the ActiveRBAC code

- Open a Ruby console window - I open mine from the InstantRails  
application’s “Manage Rails Applications…”  
dialog box

- change into the unziped directory (\_create\_db)

- run the command rbac\_mysql\_doit.bat

This will populate a database named “rbac\_test” with those tables needed  
for RBAC, plus the tables used in the  
“Articles” sample program listed within the ActiveRBAC Manual.

This set of files is required because MySQL can not properly handle  
table  
creation and constraint creation at  
the same time. SO, I had to run eight different SQL command files in  
order  
to create all of the ActiveRBAC  
tables, then create the seven ActiveRBAC constraints.

Also, this set of files creates a user “admin” with password “password”  
who has the role “Admin”.

This will at least allow you to continue along in the ActiveRBAC  
Manual’s  
Articles example.

Of course, for your own application, you will have to change the  
database  
table name listed in every  
rbac\_mysql\_X.sql file (where X=a, b, c, d, e, f, g, and h). Also, you  
will  
probably NOT need the database table  
“articles” created at the beginning of the rbac\_mysql\_a.sql file.

Happy Programming!

John Wolfe

On 5/1/06, Keegan Govender wrote:  
Hi there, I’ve installed the active\_rbac engine and am following the  
manual to install it. I’ve come to point 2.2.1 Installing Engines and  
ActiveRBAC . When I try to execute the engines migration I get the  
following error:

# C:\Documents and Settings\Keegan\My Documents\Website Work\live2move\code\L2M\>rake db:migrate:engines --trace (in C:/Documents and Settings/Keegan/My Documents/Website Work/live2move/code/L2M) \*\* Invoke db:migrate:engines (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment \*\* Execute db:migrate:engines Migrating engine ‘active\_rbac’ == ImportActiveRbacSchema: migrating

rake aborted!  
Invalid argument - /C:/Documents and Settings/Keegan/My  
Documents/Website  
Work/live2move/code/L2M/C:/Documents and Settings/Keegan/My  
Documents/Website  
Work/live2move/code/L2M/config/…/vendor/plugins/active\_rbac/db/migrate  
c:/ruby/lib/ruby/1.8/pathname.rb:341:in `lstat' c:/ruby/lib/ruby/1.8/pathname.rb:341:in`realpath’  
C:/Documents and Settings/Keegan/My Documents/Website  
Work/live2move/code/L2M/config/…/vendor/plugins/active\_rbac/db/migrate/001\_import\_active\_rbac\_schema.rb:6:in  
`real_up' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in`migrate’  
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in`migrate’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active\_record/migration.rb:331:in  
`migrate' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:326:in`migrate’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-  
1.14.0/lib/active\_record/migration.rb:293:in `up' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:284:in`migrate’  
./vendor/plugins/engines/tasks/engines.rake:80  
./vendor/plugins/engines/tasks/engines.rake:75  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in`execute’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in `invoke' c:/ruby/lib/ruby/1.8/thread.rb:135:in`synchronize’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in `invoke' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in`run’  
c:/ruby/lib/ruby/gems/1.8/gems/rake- 0.7.0/lib/rake.rb:1719:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/bin/rake:7  
c:/ruby/bin/rake.bat:25

Do you have any ideas as to what the issue is and any suggestions on how  
to go about fixing it.

Thanks, Keegan.
