# Problems using Login Engine - Rails not bound

**URL:** <https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027>\
**Category:** Engines\
**Created:** [January 23, 2006, 10:48am UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027 "2006-01-23T10:48:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@manuel](https://www.ruby-forum.com/u/manuel)\
**Post date:** [January 23, 2006, 10:48am UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027/1 "2006-01-23T10:48:58Z")

</div>

Hi list- and engineusers.

My name is Manuel and I’d like to protect my rails-application with  
the Login-engine.

I am using Debian 3.1 Sarge with the debian packages of libruby,  
libruby1.8, rake, ruby, ruby1.8, ruby1.8-dev and the gettext- and  
iconv-bindings.

I have the following gem’s installed:  
actionmailer 1.1.5  
actionpack 1.11.2  
actionwebservice 1.0.0  
activerecord 1.13.2  
activesupport 1.2.5  
login\_generator 1.1.0  
rails 1.0.0  
rake 0.7.0  
sources 0.0.1

I followed the instructions on engines-readme and login-engine-readme  
but there the first problem appeared:

I did “rake engine\_migrate ENGINE=login” and get the following error:  
"(in /home/manu/asterisk)  
The db/migrate directory for engine ‘login\_engine’ appears to be  
missing.  
Should be:  
/home/manu/asterisk/config/…//home/manu/asterisk/config/…/vendor/plugins/login\_engine/db/migrate  
"

I checked “vendor/plugins/engines/tasks/engines.rake” and changed the  
following line:  
“migration\_directory = File.join(RAILS\_ROOT, engine.root, ‘db’,  
‘migrate’)” into  
“migration\_directory = File.join(engine.root, ‘db’, ‘migrate’)” which  
worked for me.

After that I protected my whole site by adding the before\_filter into  
the application-controller and visited my site. I was forwarded to the  
login-form, but there I tried to “Register a new account” which failed  
with the following error:

" GetText::NoboundTextDomainError in User#signup

Showing vendor/plugins/login\_engine/app/views/user/signup.rhtml where  
line #4 raised:

rails is not bound.

Extracted source (around line #4):

1:

  
2: 
### Signup
  
3:  
4: \<%= error\_messages\_for ‘user’ %\>  
5:  
6: 
  
7: \<%= start\_form\_tag :action =\> ‘signup’ %\>

RAILS\_ROOT: /home/manu/asterisk/script/…/config/…"

This is the trace:  
“/usr/local/lib/site\_ruby/1.8/gettext.rb:65:in `textdomain' /usr/local/lib/site_ruby/1.8/gettext/rails.rb:176:in`error\_messages\_for’  
/usr/local/lib/site\_ruby/1.8/gettext/rails.rb:199:in  
`error_messages_for' #{RAILS_ROOT}/vendor/plugins/login_engine/app/views/user/signup.rhtml:4:in`\_run\_rhtml\_\_home\_manu\_asterisk\_vendor\_plugins\_login\_engine\_app\_views\_user\_signup’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/base.rb:292:in  
`send' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:292:in`compile\_and\_render\_template’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/base.rb:268:in  
`render_template' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:229:in`render\_file’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/base.rb:675:in  
`render_file' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:609:in`render\_with\_no\_layout’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/layout.rb:225:in  
`render_without_benchmark' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:in`render’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/benchmarking.rb:53:in  
`measure' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:in`render’  
#{RAILS\_ROOT}/vendor/plugins/login\_engine/app/controllers/user\_controller.rb:236:in  
`generate_blank' #{RAILS_ROOT}/vendor/plugins/login_engine/app/controllers/user_controller.rb:35:in`signup’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/base.rb:879:in  
`send' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:879:in`perform\_action\_without\_filters’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/filters.rb:332:in  
`perform_action_without_benchmark' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/benchmarking.rb:69:in  
`measure' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/rescue.rb:82:in  
`perform_action' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:370:in`send’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/base.rb:370:in  
`process_without_session_management_support' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:116:in`process’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/dispatcher.rb:38:in `dispatch' #{RAILS_ROOT}/vendor/rails/railties/lib/webrick_server.rb:117:in`handle\_dispatch’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/webrick\_server.rb:83:in  
`service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in`service’  
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:172:in`start\_thread’  
/usr/lib/ruby/1.8/webrick/server.rb:161:in `start' /usr/lib/ruby/1.8/webrick/server.rb:161:in`start\_thread’  
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in`each’  
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in`start’  
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start' #{RAILS_ROOT}/vendor/rails/railties/lib/webrick_server.rb:69:in`dispatch’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/commands/servers/webrick.rb:59  
#{RAILS\_ROOT}/vendor/rails/activesupport/lib/active\_support/dependencies.rb:244:in  
`require' #{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/dependencies.rb:244:in`require’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/commands/server.rb:28  
/home/manu/asterisk/script/server:3:in `require’  
/home/manu/asterisk/script/server:3”

I hope you can help me…

My configuration is pretty much like the on in the documentation.

Kind regards,

Manuel

---

<div class="post-metadata">

**Author:** ![manuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@manuel](https://www.ruby-forum.com/u/manuel)\
**Post date:** [January 23, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027/2 "2006-01-23T12:41:32Z")

</div>

Hi,

I figured out the problem… But I still can’t resolve it.

This is in my application-controller:

require ‘gettext/rails’  
require ‘login\_engine’  
GetText.output\_charset = “UTF-8”  
class ApplicationController \< ActionController::Base  
include LoginEngine  
helper :model  
model :user  
before\_filter :login\_required  
before\_filter :init\_gettext  
def init\_gettext  
bindtextdomain(“application”, request.cgi)  
end  
…

When I remove the line “bindtextdomain…” it works like a charme…  
But then I don’t have gettext-support any more.

Is there a way I could arrange both modules to work together?

The login works anyway when the bindtextdomain is present, but “forgot  
my password” and “register a new account” doesn’t work.

Kind regards,

Manuel

----- Nachricht von removed\_email\_address@domain.invalid ---------  
Datum: Mon, 23 Jan 2006 10:55:25 +0100  
Von: Manuel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Antwort an: Discussion of the use of existing Engines  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Betreff: [Engine-users] Problems using Login Engine - Rails not  
bound  
An: removed\_email\_address@domain.invalid

> actionmailer 1.1.5  
> but there the first problem appeared:  
> "migration\_directory = File.join(RAILS\_ROOT, engine.root, ‘db’,
> 
> 4: \<%= error\_messages\_for ‘user’ %\>  
> #{RAILS\_ROOT}/vendor/plugins/login\_engine/app/views/user/signup.rhtml:4:in  
> #{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/base.rb:609:in  
> `generate_blank' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in `process’  
> /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /home/manu/asterisk/script/server:3:in `require’  
> /home/manu/asterisk/script/server:3"
> 
> I hope you can help me…
> 
> My configuration is pretty much like the on in the documentation.
> 
> Kind regards,
> 
> Manuel

----- Ende der Nachricht von removed\_email\_address@domain.invalid -----

---

<div class="post-metadata">

**Author:** ![manuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@manuel](https://www.ruby-forum.com/u/manuel)\
**Post date:** [January 23, 2006, 5:56pm UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027/3 "2006-01-23T17:56:27Z")

</div>

This problem looks like it originates in the Gettext stuff, not the  
login engine… You can test if there’s an undesirable interaction  
here by trying your gettext plugin/extension in a project _without_  
the login engine. However, I’ve never heard of the ‘rails unbound’  
message you’re getting…

- james

---

<div class="post-metadata">

**Author:** ![manuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@manuel](https://www.ruby-forum.com/u/manuel)\
**Post date:** [January 23, 2006, 9:20pm UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027/4 "2006-01-23T21:20:49Z")

</div>

Well, gettext works great if I run it without the login engine. And  
the login engine  
works great if I run it without the gettext-plugin… That’s really  
bad. I crawled the  
internet for the message, but it seems that I’m the only one who ever  
got this weird  
message…

But thanks for your answer.

Kind regards,

Manuel

----- Nachricht von removed\_email\_address@domain.invalid ---------  
Datum: Mon, 23 Jan 2006 16:54:48 +0000  
Von: James A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Antwort an: Discussion of the use of existing Engines  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Betreff: Re: [Engine-users] Problems using Login Engine - Rails not  
bound  
An: Discussion of the use of existing Engines  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > model :user  
> > Is there a way I could arrange both modules to work together?  
> > ----- Nachricht von removed\_email\_address@domain.invalid ---------
> > 
> > > My name is Manuel and I’d like to protect my rails-application with  
> > > activerecord 1.13.2  
> > > "(in /home/manu/asterisk)  
> > > “migration\_directory = File.join(engine.root, ‘db’, ‘migrate’)” which  
> > > line #4 raised:  
> > > 6:
> > > 
> > >   
> > > `_run_rhtml__home_manu_asterisk_vendor_plugins_login_engine_app_views_user_signup' `render\_file’  
> > > `measure' `send’  
> > > `measure’
> > > 
> > > /usr/lib/ruby/1.8/webrick/server…rb:161:in `start\_thread’
> > 
> > * * *
> 
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

----- Ende der Nachricht von removed\_email\_address@domain.invalid -----

---

<div class="post-metadata">

**Author:** ![manuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@manuel](https://www.ruby-forum.com/u/manuel)\
**Post date:** [January 26, 2006, 9:05pm UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027/5 "2006-01-26T21:05:09Z")

</div>

Hi Manuel,

I expirienced similiar problem, but I have my own login engine, so I  
guess it’s the problem is somewhere in GetText. Can you try to add:

bindtextdomain(“rails”, request.cgi)

after your own bindtextdomain command. That worked for me, not yet sure  
how, but I realized that looking at rails.rb source from GetText  
package.

best,  
Bojan

Manuel wrote:

> Hi,
> 
> I have both running smoothly together with the following code in my  
> application-controller:
> 
> [Zitattext verstecken]  
> require ‘gettext/rails’  
> require ‘login\_engine’  
> GetText.output\_charset = “UTF-8”  
> class ApplicationController \< ActionController::Base  
> include LoginEngine  
> helper :model  
> model :user  
> before\_filter :login\_required  
> init\_gettext “asterisk”  
> The only thing now is to get the user-engine up and running. I posted  
> yesterday the rake  
> error I get when running migrate-engine (stack level too deep).  
> Your help is greatly appreciated :).
> 
> Kind regards.
> 
> Manuel
> 
> ----- Nachricht von removed\_email\_address@domain.invalid ---------  
> Datum: Mon, 23 Jan 2006 21:25:29 +0100  
> Von: Manuel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> Antwort an: Discussion of the use of existing Engines  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> Betreff: Re: [Engine-users] Problems using Login Engine - Rails not  
> bound  
> An: removed\_email\_address@domain.invalid
> 
> > Kind regards,  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> > 
> > > On 1/23/06, Manuel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > > 
> > > > include LoginEngine  
> > > > But then I don’t have gettext-support any more.
> > > > 
> > > > > Hi list- and engineusers.  
> > > > > actionpack 1.11.2
> > > > > 
> > > > > "migration\_directory = File.join(RAILS\_ROOT, engine.root, ‘db’,
> > > > > 
> > > > > 4: \<%= error\_messages\_for ‘user’ %\>  
> > > > > #{RAILS\_ROOT}/vendor/plugins/login\_engine/app/views/user/signup.rhtml:4:in  
> > > > > `render\_file’
> > > > > 
> > > > > `signup’
> > > > > 
> > > > > #{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/base.rb:370:in  
> > > > > /usr/lib/ruby/1.8/webrick/server.rb:172:in `start\_thread’  
> > > > > #{RAILS\_ROOT}/vendor/rails/activesupport/lib/active\_support/dependencies.rb:244:in
> > > 
> > > engine-users mailing list  
> > > removed\_email\_address@domain.invalid  
> > > [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)
> > 
> > ----- Ende der Nachricht von removed\_email\_address@domain.invalid -----
> 
> ----- Ende der Nachricht von removed\_email\_address@domain.invalid -----

---

<div class="post-metadata">

**Author:** ![manuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@manuel](https://www.ruby-forum.com/u/manuel)\
**Post date:** [January 24, 2006, 8:50am UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027/6 "2006-01-24T08:50:07Z")

</div>

Hi,

I have both running smoothly together with the following code in my  
application-controller:

[Zitattext verstecken]  
require ‘gettext/rails’  
require ‘login\_engine’  
GetText.output\_charset = “UTF-8”  
class ApplicationController \< ActionController::Base  
include LoginEngine  
helper :model  
model :user  
before\_filter :login\_required  
init\_gettext “asterisk”  
The only thing now is to get the user-engine up and running. I posted  
yesterday the rake  
error I get when running migrate-engine (stack level too deep).  
Your help is greatly appreciated :).

Kind regards.

Manuel

----- Nachricht von removed\_email\_address@domain.invalid ---------  
Datum: Mon, 23 Jan 2006 21:25:29 +0100  
Von: Manuel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Antwort an: Discussion of the use of existing Engines  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Betreff: Re: [Engine-users] Problems using Login Engine - Rails not  
bound  
An: removed\_email\_address@domain.invalid

> Kind regards,  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> > On 1/23/06, Manuel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > include LoginEngine  
> > > But then I don’t have gettext-support any more.
> > > 
> > > > Hi list- and engineusers.  
> > > > actionpack 1.11.2
> > > > 
> > > > "migration\_directory = File.join(RAILS\_ROOT, engine.root, ‘db’,
> > > > 
> > > > 4: \<%= error\_messages\_for ‘user’ %\>  
> > > > #{RAILS\_ROOT}/vendor/plugins/login\_engine/app/views/user/signup.rhtml:4:in  
> > > > `render\_file’
> > > > 
> > > > `signup’
> > > > 
> > > > #{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/base.rb:370:in  
> > > > /usr/lib/ruby/1.8/webrick/server.rb:172:in `start\_thread’  
> > > > #{RAILS\_ROOT}/vendor/rails/activesupport/lib/active\_support/dependencies.rb:244:in
> > 
> > engine-users mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)
> 
> ----- Ende der Nachricht von removed\_email\_address@domain.invalid -----

----- Ende der Nachricht von removed\_email\_address@domain.invalid -----

---

<div class="post-metadata">

**Author:** ![manuel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@manuel](https://www.ruby-forum.com/u/manuel)\
**Post date:** [January 28, 2006, 11:24am UTC](https://www.ruby-forum.com/t/problems-using-login-engine-rails-not-bound/53027/7 "2006-01-28T11:24:57Z")

</div>

Hi Bojan,

I think I solved the problem by initiating the engine and gettext  
plugin in the following way:

* * *

## application-controller

## require ‘gettext/rails’ require ‘login/engine’ GetText.output\_charset = “UTF-8” class ApplicationController \< ActionController::Base include LoginEngine include UserEngine helper :user model :user before\_filter :login\_required before\_filter :build\_menu init\_gettext “” … …

Kind regards

Manuel

----- Nachricht von removed\_email\_address@domain.invalid ---------  
Datum: Thu, 26 Jan 2006 21:05:09 +0100  
Von: Bojan M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Antwort an: removed\_email\_address@domain.invalid  
Betreff: Re: [Engine-users] Problems using Login Engine - Rails not  
bound  
An: removed\_email\_address@domain.invalid

> > application-controller:  
> > init\_gettext “asterisk”  
> > ----- Nachricht von removed\_email\_address@domain.invalid ---------
> > 
> > > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> > > 
> > > > > > #{RAILS\_ROOT}/vendor/plugins/login\_engine/app/views/user/signup.rhtml:4:in  
> > > > > > removed\_email\_address@domain.invalid
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> engine-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

----- Ende der Nachricht von removed\_email\_address@domain.invalid -----
