UserEngine - rake bootstrap aborted => undefined method `syn


#1

Good day all.

I have successfully installed Engines and LoginEngine and LE is setup
and
running correctly.
However, after installing and setting up UE, when attempting to run the
rake
bootstrap method I get the following error:

undefined method `synchronize_with_controllers’ for Permission:Class

My environment is
Rails 1.0.0
Ruby 1.8.2
WinXP
WebBRICK
MySQL 4.1.14

I found the following in a thread about making changes to the
user_engine/app/models/permission.rb and have done this:

BEFORE CHANGE:

we need to load all the controllers…

  controller_files.each do |file_name|
    require file_name #if /_controller.rb$/ =~ file_name
  end

AFTER CHANGE:

we need to load all the controllers…

  controller_files.sort.each do |file_name|
    require file_name #if /_controller.rb$/ =~ file_name
  end

I also made the change in the KNOWN ISSUES page of UserEngines regarding
the
addition of the following lines in the appropriate place:
guest.save
admin.save
user.save

Other than this, I can’t find anywhere that anyone else has reported
this
issue.
Has anyone seen this or experienced this type of issue before?

Thanks,
~damon


#2

On 1/19/06, Damon H. removed_email_address@domain.invalid wrote:

AFTER CHANGE:

we need to load all the controllers…

  controller_files.sort.each do |file_name|
    require file_name #if /_controller.rb$/ =~ file_name
  end

What was this change meant to solve? I can’t imagine what sorting the
controller file names would do, but anyway…

I also made the change in the KNOWN ISSUES page of UserEngines regarding the
addition of the following lines in the appropriate place:
guest.save
admin.save
user.save

If you have the latest version (downloaded any time in the past… two
weeks probably) you shouldn’t need this change. The calls to save are
in the rake file, and raise exceptions if they fail.

Other than this, I can’t find anywhere that anyone else has reported this
issue.
Has anyone seen this or experienced this type of issue before?

It might be worthwhile deleting and re-downloading your copy of the
user_engine directory, this sounds very odd. If you inspect the
Permission class (user_engine/app/models/permission.rb) you should see
the method right at the top.

  • james

#3

James–

I appreciate the quick reply.
Now, for your questions:

On 1/19/06, James A. removed_email_address@domain.invalid wrote:

On 1/19/06, Damon H. removed_email_address@domain.invalid wrote:

AFTER CHANGE:

we need to load all the controllers…

  controller_files.sort.each do |file_name|
    require file_name #if /_controller.rb$/ =~ file_name
  end

What was this change meant to solve? I can’t imagine what sorting the
controller file names would do, but anyway…

On 12/9/2005 in another thread on rake bootstrap this was listed as
needing
to be done:
n method synchronize_with_controllers find lines that say:

we need to load all the controllers…

controller_files.each do |file_name|

and add a sort call in the second one:

we need to load all the controllers…

controller_files.sort.each do |file_name|

Remove comments from the UserController and everything should work fine.

There is a dependency between UserEngine and LoginEngine which is not
taken
into account while loading controllers. It is just a quick hack but
works
for now.

It would be nice to have some way of specyfying dependencies between
engines… On the other side it might unnecessary complicate things.
Something to think about later :wink:

Other than this, I can’t find anywhere that anyone else has reported
this
issue.
Has anyone seen this or experienced this type of issue before?

It might be worthwhile deleting and re-downloading your copy of the
user_engine directory, this sounds very odd. If you inspect the
Permission class (user_engine/app/models/permission.rb) you should see
the method right at the top.

I thought this as well. Therefore, I completely removed the user_engine
directory and re-downloaded it.
Once again, running ‘rake bootstrap’ from vendor/plugins/user_engine
directory produced the same error as before.

~damon


#4

James–

That quote you are referring to came from the person posting to the list
who
suggested that change.
It was NOT my quote :slight_smile:

Doesn’t appear to be any errors when starting the enginges:

Attempting to copy public engine files from
‘./config/…/vendor/plugins/login_engine/public’
source dirs:
["./config/…/vendor/plugins/login_engine/public/stylesheets"]
Trying to start engine ‘login’ from
‘C:/Projects/adchicken/vendor/plugins/login_engine’
adding C:/Projects/adchicken/lib to the load path
adding C:/Projects/adchicken/vendor/plugins/login_engine to the load
path
adding
C:/Projects/adchicken/vendor/plugins/login_engine/lib/login_engine to
the load path
adding C:/Projects/adchicken/vendor/plugins/login_engine/app/helpers to
the
load path
adding C:/Projects/adchicken/vendor/plugins/login_engine/app/models to
the
load path
adding C:/Projects/adchicken/vendor/plugins/login_engine/app/controllers
to
the load path
Attempting to copy public engine files from
‘./script/…/config/…/vendor/plugins/login_engine/public’
source dirs:
["./script/…/config/…/vendor/plugins/login_engine/public/stylesheets"]
Trying to start engine ‘user’ from
‘C:/Projects/adchicken/vendor/plugins/user_engine’
adding C:/Projects/adchicken/lib to the load path
adding C:/Projects/adchicken/vendor/plugins/user_engine to the load path
adding C:/Projects/adchicken/vendor/plugins/user_engine/lib/user_engine
to
the load path
adding C:/Projects/adchicken/vendor/plugins/user_engine/app/helpers to
the
load path
adding C:/Projects/adchicken/vendor/plugins/user_engine/app/models to
the
load path
adding C:/Projects/adchicken/vendor/plugins/user_engine/app/controllers
to
the load path
Attempting to copy public engine files from
‘./script/…/config/…/vendor/plugins/user_engine/public’
source dirs:
["./script/…/config/…/vendor/plugins/user_engine/public/javascripts",
“./script/…/config/…/vendor/plugins/user_engine/public/stylesheets”]

Thanks,
~d


#5

On 1/19/06, Damon H. removed_email_address@domain.invalid wrote:

There is a dependency between UserEngine and LoginEngine which is not taken
into account while loading controllers. It is just a quick hack but works
for now.

I’m not sure what the dependency is that you are referring to - could
you clarify? But anyway…

I thought this as well. Therefore, I completely removed the user_engine
directory and re-downloaded it.
Once again, running ‘rake bootstrap’ from vendor/plugins/user_engine
directory produced the same error as before.

Have you looked through your logs to see if there was a problem
starting either of the engines? Post as much detail from the logs as
you have - full error messages, etc

  • james