Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

coren Console loading is broken on recursive module

#1103

Hi, It seems the console loader was somehow broken on some modules. When launching console, the error line : /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/console_with_helpers.rb:8:in include_all_modules_from':SystemStackError: stack level too deep is displayed. The console is launched, but the error is ugly. I have investigated it and found the bug. The console loader can be confused when a module include its parent, like GetText does for Rails. There's something like this in it :


module GetText
  module Rails
    include GetText
    //...
  end
end

Here is a sample step to reproduce :


1. make a rails app
> rails test
2. Install gem gettext
> sudo gem install gettext
3. Add it to your new app, in config/environment.rb :
> config.gem "gettext", :lib => "gettext/rails"
4. Install gettext_localize plugin
>  script/plugin install svn://rubyforge.org/var/svn/gettextlocalize/trunk/gettext_localize
5. Launch the console
>  ./script/console
6. you will see the ugly error this issue & the fix is about :
> "/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/console_with_helpers.rb:5:in include_all_modules_from':SystemStackError: stack level too deep "

The fix is simple and attached to this ticket. I have tried to follow the guidelines about git patch submission. Would you please review and integrate it ?

This request is re-submitted, previous one is #706 Console loading is broken on recursive module. I was not able to change it to valid again.

Regards,

Reported by coren · September 24th, 2008 @ 03:37 PM

State: wontfix
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. Flavio Mestre
  2. Donald Piret
  3. SagMor
  4. josh
    josh
    • Milestone cleared.
    • Assigned user set to josh
    • State changed from new to verified

    December 20th, 2008 @ 05:34 PM

  5. josh
    josh
    • State changed from verified to wontfix

    I think its been solved.

    
    # railties/lib/console_with_helpers.rb
    def helper
      @helper ||= ApplicationController.helpers
    end
    
    @controller = ApplicationController.new
    

    December 20th, 2008 @ 08:10 PM