Forum: Rails Engines Problems using Login Engine - Rails not bound

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9890418357b39ab019f63dfab0441d44?d=identicon&s=25 Manuel (Guest)
on 2006-01-23 10:48
(Received via mailing list)
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: <div title="<%= title_helper %>" class="form">
2:   <h3>Signup</h3>
3:
4:   <%= error_messages_for 'user' %>
5:
6:   <div class="form-padding">
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
9890418357b39ab019f63dfab0441d44?d=identicon&s=25 Manuel (Guest)
on 2006-01-23 12:41
(Received via mailing list)
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 bestellung@schurkennetz.de ---------
      Datum: Mon, 23 Jan 2006 10:55:25 +0100
        Von: Manuel <bestellung@schurkennetz.de>
Antwort an: Discussion of the use of existing Engines
<engine-users@lists.rails-engines.org>
    Betreff: [Engine-users] Problems using Login Engine - Rails not
bound
         An: engine-users@lists.rails-engines.org


>   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 bestellung@schurkennetz.de -----
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2006-01-23 17:56
(Received via mailing list)
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
9890418357b39ab019f63dfab0441d44?d=identicon&s=25 Manuel (Guest)
on 2006-01-23 21:20
(Received via mailing list)
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 james.adam@gmail.com ---------
      Datum: Mon, 23 Jan 2006 16:54:48 +0000
        Von: James Adam <james.adam@gmail.com>
Antwort an: Discussion of the use of existing Engines
<engine-users@lists.rails-engines.org>
    Betreff: Re: [Engine-users] Problems using Login Engine - Rails not
bound
         An: Discussion of the use of existing Engines
<engine-users@lists.rails-engines.org>


>>
>>    model :user
>> Is there a way I could arrange both modules to work together?
>> ----- Nachricht von bestellung@schurkennetz.de ---------
>>> 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:   <div class="form-padding">
>>> `_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...
>
>
>


----- Ende der Nachricht von james.adam@gmail.com -----
9890418357b39ab019f63dfab0441d44?d=identicon&s=25 Manuel (Guest)
on 2006-01-24 08:50
(Received via mailing list)
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 bestellung@schurkennetz.de ---------
      Datum: Mon, 23 Jan 2006 21:25:29 +0100
        Von: Manuel <bestellung@schurkennetz.de>
Antwort an: Discussion of the use of existing Engines
<engine-users@lists.rails-engines.org>
    Betreff: Re: [Engine-users] Problems using Login Engine - Rails not
bound
         An: engine-users@lists.rails-engines.org


> Kind regards,
> <engine-users@lists.rails-engines.org>
>> On 1/23/06, Manuel <bestellung@schurkennetz.de> 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
>> engine-users@lists.rails-engines.org
>> http://lists.rails-engines.org/listinfo.cgi/engine...
>>
>>
>>
>
>
> ----- Ende der Nachricht von james.adam@gmail.com -----


----- Ende der Nachricht von bestellung@schurkennetz.de -----
A7baeb0c45e5dbaac5bc496f2380061f?d=identicon&s=25 Bojan Mihelac (Guest)
on 2006-01-26 21:05
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 bestellung@schurkennetz.de ---------
>       Datum: Mon, 23 Jan 2006 21:25:29 +0100
>         Von: Manuel <bestellung@schurkennetz.de>
> Antwort an: Discussion of the use of existing Engines
> <engine-users@lists.rails-engines.org>
>     Betreff: Re: [Engine-users] Problems using Login Engine - Rails not
> bound
>          An: engine-users@lists.rails-engines.org
>
>
>> Kind regards,
>> <engine-users@lists.rails-engines.org>
>>> On 1/23/06, Manuel <bestellung@schurkennetz.de> 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
>>> engine-users@lists.rails-engines.org
>>> http://lists.rails-engines.org/listinfo.cgi/engine...
>>>
>>>
>>>
>>
>>
>> ----- Ende der Nachricht von james.adam@gmail.com -----
>
>
> ----- Ende der Nachricht von bestellung@schurkennetz.de -----
9890418357b39ab019f63dfab0441d44?d=identicon&s=25 Manuel (Guest)
on 2006-01-28 11:24
(Received via mailing list)
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 "<language-base>"
   ..
   ..
----------------------

Kind regards

Manuel




----- Nachricht von bmihelac@mihelac.org ---------
      Datum: Thu, 26 Jan 2006 21:05:09 +0100
        Von: Bojan Mihelac <bmihelac@mihelac.org>
Antwort an: engine-users@lists.rails-engines.org
    Betreff: Re: [Engine-users] Problems using Login Engine - Rails not
bound
         An: engine-users@lists.rails-engines.org


>
>> application-controller:
>>    init_gettext "asterisk"
>> ----- Nachricht von bestellung@schurkennetz.de ---------
>>> <engine-users@lists.rails-engines.org>
>>>>>> #{RAILS_ROOT}/vendor/plugins/login_engine/app/views/user/signup.rhtml:4:in
>>>> engine-users@lists.rails-engines.org
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> engine-users mailing list
> engine-users@lists.rails-engines.org
> http://lists.rails-engines.org/listinfo.cgi/engine...
>
>
>


----- Ende der Nachricht von bmihelac@mihelac.org -----
This topic is locked and can not be replied to.