Damon Hill
2006-Jan-19 14:10 UTC
[Rails] UserEngine - rake bootstrap aborted => undefined method `synchronize_with_controllers'' for Permission:Class
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/75bf526b/attachment-0001.html
James Adam
2006-Jan-19 14:32 UTC
[Rails] UserEngine - rake bootstrap aborted => undefined method `synchronize_with_controllers'' for Permission:Class
On 1/19/06, Damon Hill <mdamonhill@gmail.com> 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 > endWhat 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.saveIf 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
Damon Hill
2006-Jan-19 14:52 UTC
[Rails] UserEngine - rake bootstrap aborted => undefined method `synchronize_with_controllers'' for Permission:Class
James-- I appreciate the quick reply. Now, for your questions: On 1/19/06, James Adam <james.adam@gmail.com> wrote:> > On 1/19/06, Damon Hill <mdamonhill@gmail.com> 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 ;)> 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.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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/6e42b330/attachment-0001.html
James Adam
2006-Jan-19 15:36 UTC
[Rails] UserEngine - rake bootstrap aborted => undefined method `synchronize_with_controllers'' for Permission:Class
On 1/19/06, Damon Hill <mdamonhill@gmail.com> 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
Damon Hill
2006-Jan-19 17:24 UTC
[Rails] UserEngine - rake bootstrap aborted => undefined method `synchronize_with_controllers'' for Permission:Class
James-- That quote you are referring to came from the person posting to the list who suggested that change. It was NOT my quote :) 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 On 1/19/06, James Adam <james.adam@gmail.com> wrote:> > On 1/19/06, Damon Hill <mdamonhill@gmail.com> 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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/e61522bf/attachment.html
Possibly Parallel Threads
- UserEngine -- Permission.synchronize_with_controllers -- trouble with my own controller modules
- UserEngine - rake bootstrap aborted
- How to list all models of an application?!?
- UserEngine: stack level too deep
- Role Based Authorization recipe implementation?