Rails Engines + Login Engine



I have the same problem.
Did you figure it out?



Yes, my problem was in the engine_name/init_engine.rb file where there
was a ‘require “my_engine_name”’ , but I didn’t take attention that I
didn’t put a file named ‘my_engine_name.rb’ in engine_name/lib dir :confused:
So, if you don’t need lib, you don’t require the file in init_engine.rb.

I know it was stupid :smiley:
Hope it helps!

2005/11/7, Lou V.:


Not exactly sure what my problem is, but that wasn’t it.
No error messages in log.
No nothing.
But works w/o login_engine, so maybe I’ll leave it out for now.


Ah - yes, I see the problem now. I’ll have it fixed when I’m back in
the office later this morning.

Apologies for any inconvenice!

– james


Lou, make sure you have the latest version from SVN - if you still
have problems, email me (off list) any messages from your log files
(/log/development.log, probably) and we’ll figure it out.

– james


The reason why webbrick wouldn’t start is because init_engine.rb and
are requiring two file that I don’t have:

. authenticated_user.rb
. authenticated_system.rb

Nor could I find these two files in the tar.gz files posted at
I’m using the LoginEngine svn HEAD.

Curiously, these two files are missing in the movie, too.

If I comment these two “require” files out webbrick starts but, not
the “login_required” method cannot be found.


windows xp sp2
ruby 1.8.3
rails 0.14.3
AR 1.13.0
rake 0.6.2
LoginEngine svn head
TortoiseSVN 1.2.6


The LoginEngine should be working again, for anyone who has had
problems. The issue was caused by me making some slight changes to the
user model, moving the methods out into a module - the upshot being
that you can now create your own user model and just include the
LoginEngine::AuthenticatedUser module within it to get a resulting
Model object that plays nice with the rest of the LoginEngine code
(controllers, helpers, views).

To stop my klutzy committing causing problems like this again, I’m
thinking of re-structuring the plugin repository so we have proper
trunk/branches/tags directories in there. The reason why we didn’t
have this from the beginning is because the plugin installer script
that’s coming with Rails 1.0 didn’t look like it was going to support
this kind of structure. However, it might have been updated in the
latest RC, so I’ll inspect it again and see what the options are…

Again - apologies for breaking the code! D’oh!

  • james


Finally, it was the same problem than mine :stuck_out_tongue:
But, I don’t understand why webrick doesn’t complain when files are

2005/11/8, Lou V.:


That’s pretty much what it was. Now that script/plugin seems to play
nice with plugins in SVN trunk/ directories, the LoginEngine will be
moving into that, to stop my development killing stable versions.

You incidentally also right to point out that the demo movie doesnt
feature these files - I’m continually working on making both the
engines plugin and the login system more flexible, and catching bugs
as I find them too (since the original LoginEngine was just a straight
port of the salted hash login generator, warts and all).

  • james


thanks, James, it works!

I checked out your new svn head a few minutes ago,
but I had to comment out one (actually two) lines:

module AuthenticatedSystem

in the authenticated_system.rb file
or else I would get an error saying ‘login_required’ method not found.



It’s because of the way plugins are loaded - all errors get swallowed
up. You should still see information in the log files though.


Hi James,
I know it is a little bit off topic, but I wonder if a loginEngine
with role and permission would be in preparation? :stuck_out_tongue:

2005/11/8, James A.:


That’s fixed now Lou - just update your files from SVN.


Most of my errors show up in one of the log files, but when the
‘require’ wasn’t
able to find those two missing files there was no mention of it in the
rails log file.


Works great.
I had to figure out where pstore puts its session files on a windows box
(Local Settings\Temp\ruby_sess*) so I could log out and retest logging
But once I deleted those session files it worked first time.



As a warning to anyone using Engines with the very latest Rails - it
looks like the behaviour of the Rails code which I was overriding to
handle merging your applications controllers with Engine controllers
has changed, essentially breaking the code merging completely (views
shouldn’t be affected though)… I’m looking at how it can be fixed
at the moment.

  • james


The Engines plugin should work with edge Rails now - I’m not actually
sure what gave birth to the issue I was having, but I’ve tested it
against a fresh rails project and it runs as expected.

Of course, any problems, just let me know (off-list unless you have a
solution that might be useful to other people at the same time, this
thread is getting waaaay too long)

  • james