Problems using Login Engine - Rails not bound


#1

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:inerror_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:incompile_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:inrender_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:inrender_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:inrender’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:in
measure' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:inrender’
#{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:insignup’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:879:in
send' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:879:inperform_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:inperform_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:inperform_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:insend’
#{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:inprocess’
#{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:38:in dispatch' #{RAILS_ROOT}/vendor/rails/railties/lib/webrick_server.rb:117:inhandle_dispatch’
#{RAILS_ROOT}/vendor/rails/railties/lib/webrick_server.rb:83:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:172:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:161:in start' /usr/lib/ruby/1.8/webrick/server.rb:161:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart’
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' #{RAILS_ROOT}/vendor/rails/railties/lib/webrick_server.rb:69:indispatch’
#{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:inrequire’
#{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


#2

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
Antwort an: Discussion of the use of existing Engines
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:inprocess’
/usr/lib/ruby/1.8/webrick/server.rb:92:in each' /home/manu/asterisk/script/server:3:inrequire’
/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 -----


#3

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

#4

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
Antwort an: Discussion of the use of existing Engines
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

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

----- Ende der Nachricht von removed_email_address@domain.invalid -----


#5

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
Antwort an: Discussion of the use of existing Engines
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

On 1/23/06, Manuel 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

----- Ende der Nachricht von removed_email_address@domain.invalid -----

----- Ende der Nachricht von removed_email_address@domain.invalid -----


#6

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
Antwort an: Discussion of the use of existing Engines
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

On 1/23/06, Manuel 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

----- Ende der Nachricht von removed_email_address@domain.invalid -----

----- Ende der Nachricht von removed_email_address@domain.invalid -----


#7

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
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

#{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/.


engine-users mailing list
removed_email_address@domain.invalid
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

----- Ende der Nachricht von removed_email_address@domain.invalid -----