There is a long dating bug affecting my application for a while but I
never bothered to investigate it because it only affected the first
request to my application and only under development environment (where
autoload is used by Rails).
This is what I get:
rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-02-08 11:50:42] INFO WEBrick 1.3.1
[2013-02-08 11:50:42] INFO ruby 1.9.3 (2013-01-15) [x86_64-linux]
[2013-02-08 11:50:42] INFO WEBrick::HTTPServer#start: pid=1537 port=3000
Started POST "/search/store_state" for 127.0.0.1 at 2013-02-08 11:51:04
-0200
ActionController::RoutingError (uninitialized constant
ActionView::Helpers::NumberHelper):
lib/parse_format_utils.rb:2:in `<top (required)>'
lib/query_builder.rb:4:in `<top (required)>'
lib/search_results.rb:3:in `<top (required)>'
app/controllers/search_controller.rb:1:in `<top (required)>'
parse_format_utils.rb:2 => require 'action_view/helpers/number_helper'
I've modified it to:
begin
require 'action_view/helpers/number_helper'
rescue Exception => e
p e
puts e.backtrace.join "\n"
end
Here is the output:
> rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-02-08 11:32:04] INFO WEBrick 1.3.1
[2013-02-08 11:32:04] INFO ruby 1.9.3 (2013-01-15) [x86_64-linux]
[2013-02-08 11:32:04] INFO WEBrick::HTTPServer#start: pid=1061 port=3000
#<NameError: uninitialized constant ActionView::Helpers::NumberHelper>
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_view/helpers.rb:50:in
`<module:Helpers>'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_view/helpers.rb:4:in
`<module:ActionView>'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_view/helpers.rb:3:in
`<top (required)>'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_view/helpers/number_helper.rb:10:in
`<module:ActionView>'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_view/helpers/number_helper.rb:8:in
`<top (required)>'
/home/rodrigo/ecore/src/myapp/lib/parse_format_utils.rb:3:in `<top
(required)>'
/home/rodrigo/ecore/src/myapp/lib/query_builder.rb:4:in `<top (required)>'
/home/rodrigo/ecore/src/myapp/lib/search_results.rb:3:in `<top (required)>'
/home/rodrigo/ecore/src/myapp/app/controllers/search_controller.rb:1:in
`<top (required)>'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:230:in
`block in constantize'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in
`each'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in
`constantize'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:69:in
`controller_reference'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:54:in
`controller'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:32:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/journey-1.0.4/lib/journey/router.rb:68:in
`block in call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/journey-1.0.4/lib/journey/router.rb:56:in
`each'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/journey-1.0.4/lib/journey/router.rb:56:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:601:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/warden-1.2.1/lib/warden/manager.rb:35:in
`block in call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/warden-1.2.1/lib/warden/manager.rb:34:in
`catch'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/warden-1.2.1/lib/warden/manager.rb:34:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/best_standards_support.rb:17:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/etag.rb:23:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/head.rb:14:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/params_parser.rb:21:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/flash.rb:242:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in
`context'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/cookies.rb:341:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:28:in
`block in call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in
`_run__2728328958449052391__call__575225088242605981__callbacks'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in
`__run_callback'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in
`_run_call_callbacks'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in
`run_callbacks'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:27:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:65:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/remote_ip.rb:31:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/debug_exceptions.rb:16:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/show_exceptions.rb:56:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/rack/logger.rb:32:in
`call_app'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/rack/logger.rb:16:in
`block in call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/tagged_logging.rb:22:in
`tagged'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/rack/logger.rb:16:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/request_id.rb:22:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/runtime.rb:17:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb:72:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/lock.rb:15:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/static.rb:62:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/engine.rb:479:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application.rb:223:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/content_length.rb:14:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/rack/log_tailer.rb:17:in
`call'
/home/rodrigo/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in
`service'
/home/rodrigo/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
`service'
/home/rodrigo/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/webrick/httpserver.rb:94:in
`run'
/home/rodrigo/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/webrick/server.rb:191:in
`block in start_thread'
Any ideas what is happening here? I have no clue! Why a code like this
would automatically load helpers.rb?
helpers/number_helper.rb:
8: module ActionView
9: # = Action View Number Helpers
10: module Helpers #:nodoc:
Thanks in advance,
Rodrigo.
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.