Rails 5 Action Controller Routing error when I remove helper - ruby-on-rails

I am getting the following error when I remove a helper for a corresponding controller:
Couldn't find CompaniesHelper, expected it to be defined in helpers/companies_helper.rb
Application Trace | Framework Trace | Full Trace
app/controllers/companies_controller.rb:1:in `<main>'
I am confused by this as I didn't think the companies_controller was dependent on having a helper. Maybe I am wrong in this assumption?
I have tried in my development.rb to remove including the helpers which hasn't worked.
Any help would be appreciated!
Thanks
EDIT
Full stack trace:
Rails.root: /Users/Richard/Code/whisper
Application Trace | Framework Trace | Full Trace
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:162:in `rescue in block in modules_for_helpers'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:155:in `block in modules_for_helpers'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:144:in `map!'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:144:in `modules_for_helpers'
actionpack (5.2.0.rc2) lib/action_controller/metal/helpers.rb:94:in `modules_for_helpers'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:108:in `helper'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:186:in `default_helper_module!'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:35:in `block in inherited'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:35:in `class_eval'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:35:in `inherited'
actionview (5.2.0.rc2) lib/action_view/layouts.rb:219:in `inherited'
actionpack (5.2.0.rc2) lib/action_controller/metal/rendering.rb:23:in `inherited'
actionpack (5.2.0.rc2) lib/action_controller/metal/parameter_encoding.rb:10:in `inherited'
actionpack (5.2.0.rc2) lib/action_controller/metal/params_wrapper.rb:237:in `inherited'
actionpack (5.2.0.rc2) lib/abstract_controller/railties/routes_helpers.rb:9:in `block (2 levels) in with'
actionpack (5.2.0.rc2) lib/action_controller/railties/helpers.rb:7:in `inherited'
app/controllers/companies_controller.rb:1:in `<main>'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:468:in `block in load_file'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:653:in `new_constants_in'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:467:in `load_file'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:365:in `block in require_or_load'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:37:in `block in load_interlock'
activesupport (5.2.0.rc2) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
activesupport (5.2.0.rc2) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
activesupport (5.2.0.rc2) lib/active_support/dependencies/interlock.rb:13:in `loading'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:37:in `load_interlock'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:348:in `require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:502:in `load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:57:in `load_missing_constant'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:193:in `const_missing'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:283:in `const_get'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:283:in `block in constantize'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:281:in `each'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:281:in `inject'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:281:in `constantize'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:574:in `get'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:605:in `constantize'
actionpack (5.2.0.rc2) lib/action_dispatch/http/request.rb:88:in `controller_class_for'
actionpack (5.2.0.rc2) lib/action_dispatch/http/request.rb:81:in `controller_class'
actionpack (5.2.0.rc2) lib/action_dispatch/routing/route_set.rb:46:in `controller'
actionpack (5.2.0.rc2) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.2.0.rc2) lib/action_dispatch/journey/router.rb:52:in `block in serve'
actionpack (5.2.0.rc2) lib/action_dispatch/journey/router.rb:35:in `each'
actionpack (5.2.0.rc2) lib/action_dispatch/journey/router.rb:35:in `serve'
actionpack (5.2.0.rc2) lib/action_dispatch/routing/route_set.rb:840:in `call'
warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
warden (1.2.8) lib/warden/manager.rb:34:in `catch'
warden (1.2.8) lib/warden/manager.rb:34:in `call'
rack (2.0.6) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.0.6) lib/rack/etag.rb:25:in `call'
rack (2.0.6) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.6) lib/rack/head.rb:12:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.0.6) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.6) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/cookies.rb:670:in `call'
activerecord (5.2.0.rc2) lib/active_record/migration.rb:559:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.0.rc2) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.0.rc2) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.0.rc2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.0.rc2) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.0.rc2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.0.rc2) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.0.rc2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.6) lib/rack/method_override.rb:22:in `call'
rack (2.0.6) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.0.rc2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.6) lib/rack/sendfile.rb:111:in `call'
webpacker (3.5.5) lib/webpacker/dev_server_proxy.rb:22:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (5.2.0.rc2) lib/rails/engine.rb:524:in `call'
puma (3.12.0) lib/puma/configuration.rb:225:in `call'
puma (3.12.0) lib/puma/server.rb:658:in `handle_request'
puma (3.12.0) lib/puma/server.rb:472:in `process_client'
puma (3.12.0) lib/puma/server.rb:332:in `block in run'
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread'

For Rails 5+, By default, each controller will include all helpers.
Pre Rails 5, the controller would include a helper matched to its name. Making the setting as specified above returns to the Pre-Rails 5 behavior.
To set Pre-Rails-5 behaviour of helpers, set in config/development.rb
config.action_controller.include_all_helpers = false

Related

Wrong Number of Arguments Errors when upgrading Rails 5.2 to 6.0

I'm trying to upgrade an old site from Rails5.2 to 6.0 on the way to 6.1 - the recommended path.
I am getting various errors about wrong number of arguments, some of which I have managed to clear by updating or removing various gems. Finally I'm stuck on this one:
.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/static.rb:110:in `initialize': wrong number of arguments (given 3, expected 2) (ArgumentError)
How do I debug this and what is the underlying problem causing all the arguments errors?
Full stack track is:
/Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/static.rb:110:in `initialize': wrong number of arguments (given 3, expected 2) (ArgumentError)
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/stack.rb:37:in `new'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/stack.rb:37:in `build'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/stack.rb:131:in `block in build'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/stack.rb:127:in `each'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/stack.rb:127:in `inject'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/stack.rb:127:in `build'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/engine.rb:512:in `block in app'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/engine.rb:508:in `synchronize'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/engine.rb:508:in `app'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/application/finisher.rb:97:in `block in <module:Finisher>'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `instance_exec'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `run'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/initializable.rb:61:in `block in run_initializers'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:347:in `each'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:347:in `call'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/initializable.rb:60:in `run_initializers'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/application.rb:363:in `initialize!'
from /Users/will/Sites/projects/ggavatar/app/config/environment.rb:5:in `<top (required)>'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
from config.ru:3:in `block in <main>'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:37:in `start'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:147:in `block in perform'
from <internal:kernel>:90:in `tap'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `perform'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke'
from /Users/will/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.0.0/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
UPDATE
this blew up again shortly after the previous fix. Same error but new stack trace. I have a feeling it is to do with the cookies_serializer but I might be wrong. I have set it to hybrid according to instructions in the rails guides.
ArgumentError (wrong number of arguments (given 2, expected 1)):
json (1.8.6) lib/json/common.rb:155:in `initialize'
json (1.8.6) lib/json/common.rb:155:in `new'
json (1.8.6) lib/json/common.rb:155:in `parse'
activesupport (6.0.3.5) lib/active_support/json/decoding.rb:23:in `decode'
actionpack (6.0.3.5) lib/action_dispatch/middleware/cookies.rb:507:in `load'
actionpack (6.0.3.5) lib/action_dispatch/middleware/cookies.rb:543:in `deserialize'
actionpack (6.0.3.5) lib/action_dispatch/middleware/cookies.rb:627:in `parse'
actionpack (6.0.3.5) lib/action_dispatch/middleware/cookies.rb:461:in `[]'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/cookie_store.rb:114:in `get_cookie'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/cookie_store.rb:89:in `block (2 levels) in unpacked_cookie_data'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/abstract_store.rb:53:in `stale_session_check!'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/cookie_store.rb:88:in `block in unpacked_cookie_data'
rack (2.2.3) lib/rack/request.rb:69:in `fetch'
rack (2.2.3) lib/rack/request.rb:69:in `fetch_header'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/cookie_store.rb:87:in `unpacked_cookie_data'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/cookie_store.rb:81:in `block in extract_session_id'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/abstract_store.rb:53:in `stale_session_check!'
actionpack (6.0.3.5) lib/action_dispatch/middleware/session/cookie_store.rb:80:in `extract_session_id'
actionpack (6.0.3.5) lib/action_dispatch/request/session.rb:54:in `block in id'
actionpack (6.0.3.5) lib/action_dispatch/request/session.rb:53:in `fetch'
actionpack (6.0.3.5) lib/action_dispatch/request/session.rb:53:in `id'
actionpack (6.0.3.5) lib/action_dispatch/request/session.rb:72:in `id'
rack (2.2.3) lib/rack/session/abstract/id.rb:329:in `current_session_id'
rack (2.2.3) lib/rack/session/abstract/id.rb:335:in `session_exists?'
actionpack (6.0.3.5) lib/action_dispatch/request/session.rb:203:in `exists?'
actionpack (6.0.3.5) lib/action_dispatch/request/session.rb:226:in `load_for_read!'
actionpack (6.0.3.5) lib/action_dispatch/request/session.rb:92:in `[]'
warden (1.2.9) lib/warden/session_serializer.rb:31:in `fetch'
warden (1.2.9) lib/warden/proxy.rb:224:in `user'
warden (1.2.9) lib/warden/proxy.rb:334:in `_perform_authentication'
warden (1.2.9) lib/warden/proxy.rb:110:in `authenticate'
warden (1.2.9) lib/warden/proxy.rb:120:in `authenticate?'
devise (4.7.3) app/controllers/devise_controller.rb:109:in `require_no_authentication'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:428:in `block in make_lambda'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:181:in `block (2 levels) in halting_and_conditional'
actionpack (6.0.3.5) lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:182:in `block in halting_and_conditional'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:513:in `block in invoke_before'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:513:in `each'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:513:in `invoke_before'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:134:in `run_callbacks'
actionpack (6.0.3.5) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.3.5) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.3.5) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.3.5) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.3.5) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.3.5) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.3.5) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.3.5) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.3.5) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.3.5) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.3.5) lib/action_view/rendering.rb:39:in `process'
actionpack (6.0.3.5) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.0.3.5) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.0.3.5) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.0.3.5) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.3.5) lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
actionpack (6.0.3.5) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (6.0.3.5) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.5) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.5) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.5) lib/action_dispatch/routing/route_set.rb:834:in `call'
scout_apm (4.0.4) lib/scout_apm/instant/middleware.rb:53:in `call'
scout_apm (4.0.4) lib/scout_apm/middleware.rb:20:in `call'
bullet (6.1.4) lib/bullet/rack.rb:12:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `catch'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.0.3.5) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/cookies.rb:648:in `call'
activerecord (6.0.3.5) lib/active_record/migration.rb:567:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.3.5) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.3.5) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
rollbar (3.1.2) lib/rollbar/middleware/rails/rollbar.rb:25:in `block in call'
rollbar (3.1.2) lib/rollbar.rb:145:in `scoped'
rollbar (3.1.2) lib/rollbar/middleware/rails/rollbar.rb:22:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
rollbar (3.1.2) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
web-console (4.1.0) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.1.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `catch'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.3.5) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.0.3.5) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.3.5) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.3.5) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.3.5) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.3.5) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
request_store (1.5.0) lib/request_store/middleware.rb:19:in `call'
rack-timeout (0.6.0) lib/rack/timeout/core.rb:151:in `block in call'
rack-timeout (0.6.0) lib/rack/timeout/support/timeout.rb:19:in `timeout'
rack-timeout (0.6.0) lib/rack/timeout/core.rb:150:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (6.0.3.5) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/host_authorization.rb:82:in `call'
rack-mini-profiler (2.3.1) lib/mini_profiler/profiler.rb:373:in `call'
railties (6.0.3.5) lib/rails/engine.rb:527:in `call'
railties (6.0.3.5) lib/rails/railtie.rb:190:in `public_send'
railties (6.0.3.5) lib/rails/railtie.rb:190:in `method_missing'
puma (5.2.2) lib/puma/configuration.rb:248:in `call'
puma (5.2.2) lib/puma/request.rb:76:in `block in handle_request'
puma (5.2.2) lib/puma/thread_pool.rb:337:in `with_force_shutdown'
puma (5.2.2) lib/puma/request.rb:75:in `handle_request'
puma (5.2.2) lib/puma/server.rb:431:in `process_client'
puma (5.2.2) lib/puma/thread_pool.rb:145:in `block in spawn_thread'
source=rack-timeout id=27e40f2f-9e32-4ba3-9433-0da9a8037c07 timeout=15000ms service=407ms state=completed
UPDATE 2 - switch to rails 6.1.3
stack:
ArgumentError (wrong number of arguments (given 2, expected 1)):
json (1.8.6) lib/json/common.rb:155:in `initialize'
json (1.8.6) lib/json/common.rb:155:in `new'
json (1.8.6) lib/json/common.rb:155:in `parse'
activesupport (6.1.3) lib/active_support/json/decoding.rb:23:in `decode'
actionpack (6.1.3) lib/action_dispatch/middleware/cookies.rb:543:in `load'
actionpack (6.1.3) lib/action_dispatch/middleware/cookies.rb:579:in `deserialize'
actionpack (6.1.3) lib/action_dispatch/middleware/cookies.rb:668:in `parse'
actionpack (6.1.3) lib/action_dispatch/middleware/cookies.rb:482:in `[]'
actionpack (6.1.3) lib/action_dispatch/middleware/session/cookie_store.rb:114:in `get_cookie'
actionpack (6.1.3) lib/action_dispatch/middleware/session/cookie_store.rb:89:in `block (2 levels) in unpacked_cookie_data'
actionpack (6.1.3) lib/action_dispatch/middleware/session/abstract_store.rb:53:in `stale_session_check!'
actionpack (6.1.3) lib/action_dispatch/middleware/session/cookie_store.rb:88:in `block in unpacked_cookie_data'
rack (2.2.3) lib/rack/request.rb:69:in `fetch'
rack (2.2.3) lib/rack/request.rb:69:in `fetch_header'
actionpack (6.1.3) lib/action_dispatch/middleware/session/cookie_store.rb:87:in `unpacked_cookie_data'
actionpack (6.1.3) lib/action_dispatch/middleware/session/cookie_store.rb:81:in `block in extract_session_id'
actionpack (6.1.3) lib/action_dispatch/middleware/session/abstract_store.rb:53:in `stale_session_check!'
actionpack (6.1.3) lib/action_dispatch/middleware/session/cookie_store.rb:80:in `extract_session_id'
actionpack (6.1.3) lib/action_dispatch/request/session.rb:54:in `block in id'
actionpack (6.1.3) lib/action_dispatch/request/session.rb:53:in `fetch'
actionpack (6.1.3) lib/action_dispatch/request/session.rb:53:in `id'
actionpack (6.1.3) lib/action_dispatch/request/session.rb:72:in `id'
rack (2.2.3) lib/rack/session/abstract/id.rb:329:in `current_session_id'
rack (2.2.3) lib/rack/session/abstract/id.rb:335:in `session_exists?'
actionpack (6.1.3) lib/action_dispatch/request/session.rb:203:in `exists?'
actionpack (6.1.3) lib/action_dispatch/request/session.rb:226:in `load_for_read!'
actionpack (6.1.3) lib/action_dispatch/request/session.rb:92:in `[]'
warden (1.2.9) lib/warden/session_serializer.rb:31:in `fetch'
warden (1.2.9) lib/warden/proxy.rb:224:in `user'
warden (1.2.9) lib/warden/proxy.rb:334:in `_perform_authentication'
warden (1.2.9) lib/warden/proxy.rb:110:in `authenticate'
warden (1.2.9) lib/warden/proxy.rb:120:in `authenticate?'
devise (4.7.3) app/controllers/devise_controller.rb:109:in `require_no_authentication'
activesupport (6.1.3) lib/active_support/callbacks.rb:427:in `block in make_lambda'
activesupport (6.1.3) lib/active_support/callbacks.rb:179:in `block (2 levels) in halting_and_conditional'
actionpack (6.1.3) lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
activesupport (6.1.3) lib/active_support/callbacks.rb:180:in `block in halting_and_conditional'
activesupport (6.1.3) lib/active_support/callbacks.rb:512:in `block in invoke_before'
activesupport (6.1.3) lib/active_support/callbacks.rb:512:in `each'
activesupport (6.1.3) lib/active_support/callbacks.rb:512:in `invoke_before'
activesupport (6.1.3) lib/active_support/callbacks.rb:115:in `block in run_callbacks'
activesupport (6.1.3) lib/active_support/callbacks.rb:137:in `run_callbacks'
actionpack (6.1.3) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.1.3) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.1.3) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (6.1.3) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.3) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.3) lib/active_support/notifications.rb:203:in `instrument'
actionpack (6.1.3) lib/action_controller/metal/instrumentation.rb:33:in `process_action'
actionpack (6.1.3) lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
activerecord (6.1.3) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.1.3) lib/abstract_controller/base.rb:165:in `process'
actionview (6.1.3) lib/action_view/rendering.rb:39:in `process'
actionpack (6.1.3) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.1.3) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.1.3) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.1.3) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.1.3) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.1.3) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (6.1.3) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (6.1.3) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.1.3) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.1.3) lib/action_dispatch/routing/route_set.rb:842:in `call'
scout_apm (4.0.4) lib/scout_apm/instant/middleware.rb:53:in `call'
scout_apm (4.0.4) lib/scout_apm/middleware.rb:20:in `call'
bullet (6.1.4) lib/bullet/rack.rb:12:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `catch'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.1.3) lib/action_dispatch/http/permissions_policy.rb:22:in `call'
actionpack (6.1.3) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (6.1.3) lib/active_record/migration.rb:601:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.1.3) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (6.1.3) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
rollbar (3.1.2) lib/rollbar/middleware/rails/rollbar.rb:25:in `block in call'
rollbar (3.1.2) lib/rollbar.rb:145:in `scoped'
rollbar (3.1.2) lib/rollbar/middleware/rails/rollbar.rb:22:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
rollbar (3.1.2) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
web-console (4.1.0) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.1.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `catch'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.1.3) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.1.3) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.1.3) lib/active_support/tagged_logging.rb:99:in `block in tagged'
activesupport (6.1.3) lib/active_support/tagged_logging.rb:37:in `tagged'
activesupport (6.1.3) lib/active_support/tagged_logging.rb:99:in `tagged'
railties (6.1.3) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
request_store (1.5.0) lib/request_store/middleware.rb:19:in `call'
rack-timeout (0.6.0) lib/rack/timeout/core.rb:151:in `block in call'
rack-timeout (0.6.0) lib/rack/timeout/support/timeout.rb:19:in `timeout'
rack-timeout (0.6.0) lib/rack/timeout/core.rb:150:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/request_id.rb:26:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (6.1.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/static.rb:24:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.1.3) lib/action_dispatch/middleware/host_authorization.rb:98:in `call'
rack-mini-profiler (2.3.1) lib/mini_profiler/profiler.rb:373:in `call'
railties (6.1.3) lib/rails/engine.rb:539:in `call'
railties (6.1.3) lib/rails/railtie.rb:207:in `public_send'
railties (6.1.3) lib/rails/railtie.rb:207:in `method_missing'
puma (5.2.2) lib/puma/configuration.rb:248:in `call'
puma (5.2.2) lib/puma/request.rb:76:in `block in handle_request'
puma (5.2.2) lib/puma/thread_pool.rb:337:in `with_force_shutdown'
puma (5.2.2) lib/puma/request.rb:75:in `handle_request'
puma (5.2.2) lib/puma/server.rb:431:in `process_client'
puma (5.2.2) lib/puma/thread_pool.rb:145:in `block in spawn_thread'
source=rack-timeout id=ef317074-a4fb-4e9e-a6f4-cd2ddd1db3c5 timeout=15000ms service=367ms state=completed
EDIT - Looks like you fixed it by upgrading to a newer release. I expect if you look at the changes between your versions they will have fixed the issue I've outlined below.
I'm assuming you upgraded to Ruby 3.0.0 at the same time as upgrading Rails. I've recently done exactly the same thing, and can with some certainty say that you're hitting an issue with changes to how keyword arguments are handled in Ruby 3.
You should read this article which explains the changes: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
Here is an example of how I had to fix this within my code.
Before Ruby 3:
def self.fetch(*args)
new(*args).fetch
end
def self.update(property, category: "default", site:, value:)
args = [property, category: category, site: site]
new(*args).update(value)
end
After Ruby 3:
def self.fetch(*args, **kwargs)
new(*args, **kwargs).fetch
end
def self.update(property, category: "default", site:, value:)
args = [property]
kwargs = { category: category, site: site }
new(*args, **kwargs).update(value)
end
I found a fix for this.
There's an issue with parsing JSON:
json (1.8.6) lib/json/common.rb:155:in parse'`
The fix for that I found here: https://github.com/flori/json/issues/399#issuecomment-734863279
It means adding a config/initializers/json.rb file to override the current parse:
module JSON
module_function
def parse(source, opts = {})
Parser.new(source, **opts).parse
end
end

RubyOnRails: SQL injection causes ActionController::BadRequest which cannot be handled

I am getting SQL-injection url requests such as: ?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=12345.php&vars[1][1]=
which is causing a:
ActionController::BadRequest (Invalid query parameters: expected Hash (got Array) for param `1'):
in my home#index. I believe the error is caught in a middleware or routing as I cannot catch the error in the home#index controller (or application controller either).
This is my development log response to the url:
ActionController::BadRequest (Invalid query parameters: expected Hash (got Array) for param `1'):
rack (1.6.11) lib/rack/utils.rb:162:in `normalize_params'
rack (1.6.11) lib/rack/utils.rb:163:in `normalize_params'
rack (1.6.11) lib/rack/utils.rb:122:in `block in parse_nested_query'
rack (1.6.11) lib/rack/utils.rb:119:in `each'
rack (1.6.11) lib/rack/utils.rb:119:in `parse_nested_query'
rack (1.6.11) lib/rack/request.rb:371:in `parse_query'
actionpack (4.2.10) lib/action_dispatch/http/request.rb:339:in `parse_query'
rack (1.6.11) lib/rack/request.rb:191:in `GET'
actionpack (4.2.10) lib/action_dispatch/http/request.rb:300:in `GET'
actionpack (4.2.10) lib/action_dispatch/http/parameters.rb:14:in `parameters'
actionpack (4.2.10) lib/action_dispatch/http/filter_parameters.rb:37:in `filtered_parameters'
actionpack (4.2.10) lib/action_controller/metal/instrumentation.rb:22:in `process_action'
actionpack (4.2.10) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.10) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.10) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.10) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.10) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.10) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.10) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:817:in `call'
bullet (6.0.2) lib/bullet/rack.rb:12:in `call'
rack (1.6.11) lib/rack/etag.rb:24:in `call'
rack (1.6.11) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.11) lib/rack/head.rb:13:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.11) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.11) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.10) lib/active_record/query_cache.rb:36:in `call'
airbrake (9.4.3) lib/airbrake/rack/middleware.rb:32:in `call!'
airbrake (9.4.3) lib/airbrake/rack/middleware.rb:21:in `call'
activerecord (4.2.10) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.10) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.10) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.10) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.10) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.10) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.10) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.10) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.10) lib/rails/rack/logger.rb:20:in `call'
request_store (1.4.1) lib/request_store/middleware.rb:19:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.11) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.11) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.10) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.11) lib/rack/lock.rb:17:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.11) lib/rack/sendfile.rb:113:in `call'
utf8-cleaner (0.2.5) lib/utf8-cleaner/middleware.rb:21:in `call'
railties (4.2.10) lib/rails/engine.rb:518:in `call'
railties (4.2.10) lib/rails/application.rb:165:in `call'
rack (1.6.11) lib/rack/content_length.rb:15:in `call'
thin (1.7.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.7.2) lib/thin/connection.rb:84:in `catch'
thin (1.7.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.7.2) lib/thin/connection.rb:53:in `process'
thin (1.7.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.2.7) lib/eventmachine.rb:195:in `run_machine'
eventmachine (1.2.7) lib/eventmachine.rb:195:in `run'
thin (1.7.2) lib/thin/backends/base.rb:73:in `start'
thin (1.7.2) lib/thin/server.rb:162:in `start'
rack (1.6.11) lib/rack/handler/thin.rb:19:in `run'
rack (1.6.11) lib/rack/server.rb:287:in `start'
railties (4.2.10) lib/rails/commands/server.rb:80:in `start'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:80:in `block in server'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:75:in `tap'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:75:in `server'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
railties (4.2.10) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<top (required)>'
spring (2.1.0) lib/spring/client/rails.rb:28:in `load'
spring (2.1.0) lib/spring/client/rails.rb:28:in `call'
spring (2.1.0) lib/spring/client/command.rb:7:in `call'
spring (2.1.0) lib/spring/client.rb:30:in `run'
spring (2.1.0) bin/spring:49:in `<top (required)>'
spring (2.1.0) lib/spring/binstub.rb:11:in `load'
spring (2.1.0) lib/spring/binstub.rb:11:in `<top (required)>'
bin/spring:13:in `require'
bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
How can I make sure these spam/sql inject-requests are being handled so they don't cause exceptions?
In Your Application Controller:
rescue_from ActionController::BadRequest, with: :bad_request
def bad_request(exception)
render status: 400, json: {:error => exception.message}.to_json
end
I came across this same issue this evening. The error is being thrown before ApplicationController begins to handle the request so catching it in ApplicationController won't work because it's too late.
What you need to do is insert a piece of middleware that catches ActionController::BadRequest before the ActionDispatch::ParamsParser middleware which is throwing the error.
Example which catches the error, adds it to the log and then returns a plain text 400 page.
# app/middleware/catch_batch_request_error_mw.rb
class CatchBadRequestErrorMw
def initialize(app)
#app = app
end
def call(env)
begin
#app.call(env)
rescue ActionController::BadRequest => e
Rails.logger.error("CatchBadRequestErrorMw: #{e.message}")
return [
400,
{
'Content-Type': 'text/plain',
},
['Bad Request']
]
end
end
end
And then in Application.rb
config.middleware.insert_before(ActionDispatch::ParamsParser, CatchBadRequestErrorMw)
I should note that the examples here are from a Rails 4.2 app so if you have any issues I'd start there.

Ruby on Rails how do I create a has_one dependency on the creation of user

I am attempting to create an association between
class User
has_one :user_profile
end
class UserProfile
belongs_to :user
end
I want to create the ability to create the association when the user is created.
I have attempted things in the User Model like
before_create :build_profile
private
def build_profile
default_pararms = { some_key: value}
#profile = self.create_user_pofile!(default_params)
end
---- stack is returning ----
Redirected to http://localhost:3000/users
Completed 302 Found in 136ms (ActiveRecord: 0.3ms)
Started GET "/users" for 127.0.0.1 at 2018-03-31 01:56:40 -0400
ActionController::RoutingError (uninitialized constant UsersController):
activesupport (5.1.5) lib/active_support/inflector/methods.rb:269:in `const_get'
activesupport (5.1.5) lib/active_support/inflector/methods.rb:269:in `block in constantize'
activesupport (5.1.5) lib/active_support/inflector/methods.rb:267:in `each'
activesupport (5.1.5) lib/active_support/inflector/methods.rb:267:in `inject'
activesupport (5.1.5) lib/active_support/inflector/methods.rb:267:in `constantize'
actionpack (5.1.5) lib/action_dispatch/http/request.rb:85:in `controller_class_for'
actionpack (5.1.5) lib/action_dispatch/http/request.rb:78:in `controller_class'
actionpack (5.1.5) lib/action_dispatch/routing/route_set.rb:43:in `controller'
actionpack (5.1.5) lib/action_dispatch/routing/route_set.rb:29:in `serve'
actionpack (5.1.5) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.5) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.5) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.5) lib/action_dispatch/routing/route_set.rb:844:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.4) lib/rack/etag.rb:25:in `call'
rack (2.0.4) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.4) lib/rack/head.rb:12:in `call'
rack (2.0.4) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.4) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.5) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.5) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.5) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.5) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.5) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.5) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.5) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.5) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.5) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.4) lib/rack/method_override.rb:22:in `call'
rack (2.0.4) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.5) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.4) lib/rack/sendfile.rb:111:in `call'
railties (5.1.5) lib/rails/engine.rb:522:in `call'
puma (3.11.3) lib/puma/configuration.rb:225:in `call'
puma (3.11.3) lib/puma/server.rb:624:in `handle_request'
puma (3.11.3) lib/puma/server.rb:438:in `process_client'
puma (3.11.3) lib/puma/server.rb:302:in `block in run'
puma (3.11.3) lib/puma/thread_pool.rb:120:in `block in spawn_thread'

PayPal REST API OAuth Response error

i am trying the PayPal REST API for Ruby on Rails, i am following the example "OAuth Request / Response" from https://developer.paypal.com/webapps/developer/docs/api/ for Ruby:
class PaymentsController < ApplicationController
include PayPal::SDK::REST
def pay
#api = PayPal::SDK::REST.set_config(
:ssl_options => {}, # Set ssl options
:mode => :sandbox, # Set :sandbox or :live
:client_id => "XXXXXXXXXXX",
:client_secret => "XXXXXXXXXXX" )
#api.token
end
end
And i don't know why, but i receive the next error.
LoadError in PaymentsController#pay
no such file to load -- {"scope":"openid https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card/.* https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/developer/.*","access_token":"Mnlhn0RcJ9KWQTU6z5-cH5iDu8aeMzOM7TACw1NhFp0","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":28800}
full trace
activesupport (3.0.20) lib/active_support/dependencies.rb:236:in `load'
activesupport (3.0.20) lib/active_support/dependencies.rb:236:in `block in load'
activesupport (3.0.20) lib/active_support/dependencies.rb:225:in `block in load_dependency'
activesupport (3.0.20) lib/active_support/dependencies.rb:597:in `new_constants_in'
activesupport (3.0.20) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.20) lib/active_support/dependencies.rb:236:in `load'
paypal-sdk-core (0.2.6) lib/paypal-sdk/core/api/rest.rb:58:in `token_hash'
paypal-sdk-core (0.2.6) lib/paypal-sdk/core/api/rest.rb:65:in `token'
app/controllers/payments_controller.rb:15:in `pay'
actionpack (3.0.20) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.20) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.20) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.20) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.20) lib/active_support/callbacks.rb:456:in `_run__1063560453__process_action__391973748__callbacks'
activesupport (3.0.20) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.20) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.20) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.20) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.20) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.0.20) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.20) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.20) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.20) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:in `block in perform_action_with_newrelic_trace'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/method_tracer.rb:240:in `trace_execution_scoped'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:in `perform_action_with_newrelic_trace'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
actionpack (3.0.20) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.20) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.20) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.20) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.20) lib/action_controller/metal.rb:178:in `block in action'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:68:in `call'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:499:in `call'
oink (0.9.3) lib/oink/middleware.rb:17:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/error_collector.rb:8:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/agent_hooks.rb:14:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/browser_monitoring.rb:12:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/developer_mode.rb:24:in `call'
warden (1.0.6) lib/warden/manager.rb:35:in `block in call'
warden (1.0.6) lib/warden/manager.rb:34:in `catch'
warden (1.0.6) lib/warden/manager.rb:34:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.7) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.20) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.20) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.20) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.20) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.20) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.20) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.20) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.7) lib/rack/sendfile.rb:106:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.20) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.7) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.20) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.7) lib/rack/lock.rb:13:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.7) lib/rack/lock.rb:13:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/static.rb:30:in `call'
airbrake (3.1.6) lib/airbrake/rack.rb:41:in `call'
airbrake (3.1.6) lib/airbrake/user_informer.rb:12:in `call'
railties (3.0.20) lib/rails/application.rb:168:in `call'
railties (3.0.20) lib/rails/application.rb:77:in `method_missing'
railties (3.0.20) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.7) lib/rack/content_length.rb:13:in `call'
rack (1.2.7) lib/rack/handler/webrick.rb:52:in `service'
/home/jorge/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/jorge/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/jorge/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
This error occurred while loading the following files:
{"scope":"openid https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card/.* https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/developer/.*","access_token":"Mnlhn0RcJ9KWQTU6z5-cH5iDu8aeMzOM7TACw1NhFp0","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":28800}
SOLVED: update the multi_json gem to last version.
update the multi_json gem to last version.

ImageScience w/ Rails 3

I'm trying to get ImageScience working w/ my rails 3 app. When I try to do require 'image_science' in one of my controllers I get:
LoadError in Api::ImagesController#server
require on /Users/Kyle/.ruby_inline/Inline_ImageScience_cdab.bundle failed
This error occurred while loading the following files:
image_science
Full Trace
RubyInline (3.9.0) lib/inline.rb:513:in `load'
RubyInline (3.9.0) lib/inline.rb:829:in `inline'
image_science (1.2.1) lib/image_science.rb:90:in `<class:ImageScience>'
image_science (1.2.1) lib/image_science.rb:13:in `<top (required)>'
activesupport (3.0.7) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.7) lib/active_support/dependencies.rb:239:in `block in require'
activesupport (3.0.7) lib/active_support/dependencies.rb:225:in `block in load_dependency'
activesupport (3.0.7) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.7) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.7) lib/active_support/dependencies.rb:239:in `require'
app/controllers/api/images_controller.rb:3:in `<top (required)>'
activesupport (3.0.7) lib/active_support/dependencies.rb:454:in `load'
activesupport (3.0.7) lib/active_support/dependencies.rb:454:in `block in load_file'
activesupport (3.0.7) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.7) lib/active_support/dependencies.rb:453:in `load_file'
activesupport (3.0.7) lib/active_support/dependencies.rb:340:in `require_or_load'
activesupport (3.0.7) lib/active_support/dependencies.rb:491:in `load_missing_constant'
activesupport (3.0.7) lib/active_support/dependencies.rb:183:in `block in const_missing'
activesupport (3.0.7) lib/active_support/dependencies.rb:181:in `each'
activesupport (3.0.7) lib/active_support/dependencies.rb:181:in `const_missing'
activesupport (3.0.7) lib/active_support/inflector/methods.rb:124:in `block in constantize'
activesupport (3.0.7) lib/active_support/inflector/methods.rb:123:in `each'
activesupport (3.0.7) lib/active_support/inflector/methods.rb:123:in `constantize'
activesupport (3.0.7) lib/active_support/dependencies.rb:528:in `block in <class:Reference>'
activesupport (3.0.7) lib/active_support/dependencies.rb:538:in `yield'
activesupport (3.0.7) lib/active_support/dependencies.rb:538:in `default'
activesupport (3.0.7) lib/active_support/dependencies.rb:538:in `get'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:58:in `controller_reference'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:44:in `controller'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:23:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:89:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:493:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/builder.rb:30:in `call'
sass (3.1.3) lib/sass/plugin/rack.rb:54:in `call'
warden (1.0.4) lib/warden/manager.rb:35:in `block in call'
warden (1.0.4) lib/warden/manager.rb:34:in `catch'
warden (1.0.4) lib/warden/manager.rb:34:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.3) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
flash_cookie_session (1.1.1) lib/flash_cookie_session/middleware.rb:18:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.7) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.7) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.7) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.7) lib/rails/application.rb:168:in `call'
railties (3.0.7) lib/rails/application.rb:77:in `method_missing'
railties (3.0.7) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/chunked.rb:15:in `call'
thin (1.2.11) lib/thin/connection.rb:84:in `block in pre_process'
thin (1.2.11) lib/thin/connection.rb:82:in `catch'
thin (1.2.11) lib/thin/connection.rb:82:in `pre_process'
thin (1.2.11) lib/thin/connection.rb:57:in `process'
thin (1.2.11) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.2.11) lib/thin/backends/base.rb:61:in `start'
thin (1.2.11) lib/thin/server.rb:159:in `start'
rack (1.2.3) lib/rack/handler/thin.rb:14:in `run'
rack (1.2.3) lib/rack/server.rb:217:in `start'
railties (3.0.7) lib/rails/commands/server.rb:65:in `start'
railties (3.0.7) lib/rails/commands.rb:30:in `block in <top (required)>'
railties (3.0.7) lib/rails/commands.rb:27:in `tap'
railties (3.0.7) lib/rails/commands.rb:27:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'

Resources