Currently, I'm building an application that can login via fb/g+ using doorkeeper and doorkeeper-grant_assertion. Previously, everything is okay but just a sudden I encounter this problem which is unfamiliar to me and even I already google it still can't find someone who had encounter this problem.
class Oauth::TokensController < Doorkeeper::TokensController
def create
response = authorize_response
self.headers.merge! response.headers
self.response_body =
if response.status == :ok
json_success( response )
else
json_fail( response )
end
end
end
UPDATE
- doorkeeper (3.0.1) lib/doorkeeper/server.rb:16:in `token_request'
- doorkeeper (3.0.1) app/controllers/doorkeeper/tokens_controller.rb:38:in `strategy'
- doorkeeper (3.0.1) app/controllers/doorkeeper/tokens_controller.rb:42:in `authorize_response'
- app/controllers/oauth/tokens_controller.rb:4:in `create'
- actionpack (4.2.5.1) lib/abstract_controller/base.rb:198:in `process_action'
- actionpack (4.2.5.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
- activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in `block in instrument'
- activesupport (4.2.5.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
- activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in `instrument'
- actionpack (4.2.5.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
- actionpack (4.2.5.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
- actionpack (4.2.5.1) lib/abstract_controller/base.rb:137:in `process'
- actionpack (4.2.5.1) lib/action_controller/metal.rb:196:in `dispatch'
- actionpack (4.2.5.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
- actionpack (4.2.5.1) lib/action_controller/metal.rb:237:in `block in action'
- actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
- actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:43:in `serve'
- actionpack (4.2.5.1) lib/action_dispatch/journey/router.rb:43:in `block in serve'
- actionpack (4.2.5.1) lib/action_dispatch/journey/router.rb:30:in `serve'
- actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:815:in `call'
- omniauth (1.3.1) lib/omniauth/strategy.rb:186:in `call!'
- omniauth (1.3.1) lib/omniauth/strategy.rb:164:in `call'
- omniauth (1.3.1) lib/omniauth/strategy.rb:186:in `call!'
- omniauth (1.3.1) lib/omniauth/strategy.rb:164:in `call'
- rack-attack (4.4.1) lib/rack/attack.rb:107:in `call'
- warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
- warden (1.2.6) lib/warden/manager.rb:34:in `call'
- rack (1.6.4) lib/rack/etag.rb:24:in `call'
- rack (1.6.4) lib/rack/conditionalget.rb:38:in `call'
- rack (1.6.4) lib/rack/head.rb:13:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/flash.rb:260:in `call'
- rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
- rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
- activerecord (4.2.5.1) lib/active_record/query_cache.rb:36:in `call'
- activerecord (4.2.5.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
- activerecord (4.2.5.1) lib/active_record/migration.rb:377:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
- activesupport (4.2.5.1) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
- activesupport (4.2.5.1) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
- activesupport (4.2.5.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
- railties (4.2.5.1) lib/rails/rack/logger.rb:38:in `call_app'
- railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `block in call'
- activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
- activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:26:in `tagged'
- activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `tagged'
- railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `call'
- quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
- request_store (1.3.0) lib/request_store/middleware.rb:9:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
- rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
- rack (1.6.4) lib/rack/runtime.rb:18:in `call'
- activesupport (4.2.5.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
- rack (1.6.4) lib/rack/lock.rb:17:in `call'
- actionpack (4.2.5.1) lib/action_dispatch/middleware/static.rb:116:in `call'
- rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
- rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
- railties (4.2.5.1) lib/rails/engine.rb:518:in `call'
- railties (4.2.5.1) lib/rails/application.rb:165:in `call'
- rack (1.6.4) lib/rack/content_length.rb:15:in `call'
- thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
- thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
- thin (1.5.1) lib/thin/connection.rb:54:in `process'
- thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
- eventmachine (1.0.9.1) lib/eventmachine.rb:193:in `run'
- thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
- thin (1.5.1) lib/thin/server.rb:159:in `start'
- rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
- rack (1.6.4) lib/rack/server.rb:286:in `start'
- railties (4.2.5.1) lib/rails/commands/server.rb:80:in `start'
- railties (4.2.5.1) lib/rails/commands/commands_tasks.rb:80:in `block in server'
- railties (4.2.5.1) lib/rails/commands/commands_tasks.rb:75:in `server'
- railties (4.2.5.1) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
- railties (4.2.5.1) lib/rails/commands.rb:17:in `
Thanks.
Related
I am getting the following error after I try creating a new Ruby app with rails new app-name-1. When I first run the server with rails s I get this:
AbstractController::Helpers::MissingHelperError in
Rails::WelcomeController#index Missing helper file
helpers/c:/users/aaa/google drive/web
apps/fake_orders_3/app/helpers/application_helper.rb_helper.rb
Rails.root: C:/users/aaa/google drive/web apps/fake-orders-3
actionpack (4.2.6) lib/abstract_controller/helpers.rb:151:in `rescue in block in modules_for_helpers' actionpack (4.2.6) lib/abstract_controller/helpers.rb:148:in `block in modules_for_helpers' actionpack (4.2.6) lib/abstract_controller/helpers.rb:144:in `map!' actionpack (4.2.6) lib/abstract_controller/helpers.rb:144:in `modules_for_helpers' actionpack (4.2.6) lib/action_controller/metal/helpers.rb:93:in `modules_for_helpers' actionpack (4.2.6)
lib/abstract_controller/helpers.rb:108:in `helper' actionpack (4.2.6) lib/action_controller/railties/helpers.rb:17:in `inherited' railties (4.2.6) lib/rails/application_controller.rb:1:in `<top (required)>' activesupport (4.2.6) lib/active_support/dependencies.rb:274:in `require' activesupport (4.2.6) lib/active_support/dependencies.rb:274:in `block in require' activesupport (4.2.6) lib/active_support/dependencies.rb:240:in `load_dependency' activesupport (4.2.6) lib/active_support/dependencies.rb:274:in `require' railties (4.2.6) lib/rails/welcome_controller.rb:1:in `<top (required)>' activesupport (4.2.6)
lib/active_support/inflector/methods.rb:263:in `const_get' activesupport (4.2.6) lib/active_support/inflector/methods.rb:263:in `block in constantize' activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `each' activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `inject' activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `constantize' activesupport (4.2.6) lib/active_support/dependencies.rb:566:in `get' activesupport (4.2.6) lib/active_support/dependencies.rb:597:in `constantize' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:70:in `controller_reference' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:60:in `controller' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:39:in `serve' actionpack (4.2.6)
lib/action_dispatch/journey/router.rb:43:in `block in serve' actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each' actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call' rack (1.6.4) lib/rack/etag.rb:24:in `call' rack (1.6.4) lib/rack/conditionalget.rb:25:in `call' rack (1.6.4) lib/rack/head.rb:13:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call' rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context' rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call' activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call' activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call' activerecord (4.2.6) lib/active_record/migration.rb:377:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__' activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks' activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call' actionpack (4.2.6) 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.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.6) lib/
rails/rack/logger.rb:38:in `call_app' railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.2.6) lib/rails/rack/logger.rb:20:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' rack (1.6.4) lib/rack/runtime.rb:18:in `call' activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' rack (1.6.4) lib/rack/lock.rb:17:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call' rack (1.6.4) lib/rack/sendfile.rb:113:in `call' railties (4.2.6) lib/rails/engine.rb:518:in `call' railties (4.2.6) lib/rails/application.rb:165:in `call' rack (1.6.4) lib/rack/lock.rb:17:in `call' rack (1.6.4) lib/rack/content_length.rb:15:in `call' rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' C:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' C:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' C:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' This error occurred while loading the following files: rails/application_controller
I'm not a ruby on rails developer so this might be a menial fix. The friend I'm working on with this project is currently unavailable and was hoping someone could help me resolve this issue that sprang up randomly after reboot my VM. No changes to any files, it was just working and after reboot it wasn't. Tried googling to no avail.
Here is the full post from the console:
SyntaxError - syntax error, unexpected '%'
...er layout:'application', text:%q(<ng-include src="'/drinks/e...
... ^
/home/sirtastic/projects/tipsy-web/app/controllers/drinks_controller.rb:67: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
...ation', text:%q(<ng-include src="'/drinks/edit.html'"></ng-i...
... ^
/home/sirtastic/projects/tipsy-web/app/controllers/drinks_controller.rb:67: syntax error, unexpected '<'
...ude src="'/drinks/edit.html'"></ng-include>)
... ^
/home/sirtastic/projects/tipsy-web/app/controllers/drinks_controller.rb:67: unterminated regexp meets end of file:
app/controllers/drinks_controller.rb:67:in `'
activesupport (4.2.0) lib/active_support/dependencies.rb:457:in `block in load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:647:in `new_constants_in'
activesupport (4.2.0) lib/active_support/dependencies.rb:456:in `load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:354:in `require_or_load'
activesupport (4.2.0) lib/active_support/dependencies.rb:494:in `load_missing_constant'
activesupport (4.2.0) lib/active_support/dependencies.rb:184:in `const_missing'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:261:in `block in constantize'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:259:in `constantize'
activesupport (4.2.0) lib/active_support/dependencies.rb:566:in `get'
activesupport (4.2.0) lib/active_support/dependencies.rb:597:in `constantize'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:69:in `controller_reference'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:59:in `controller'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:38:in `serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.6.1) lib/rack/etag.rb:24:in `call'
rack (1.6.1) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.1) lib/rack/head.rb:13:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.1) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.1) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
activerecord (4.2.0) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.1.2) lib/web_console/middleware.rb:37:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.1) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.1) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.1) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.1) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
rack (1.6.1) lib/rack/lock.rb:17:in `call'
rack (1.6.1) lib/rack/content_length.rb:15:in `call'
rack (1.6.1) lib/rack/handler/webrick.rb:89:in `service'
/usr/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/usr/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/usr/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Started POST "/__better_errors/6570466af1f32e70/variables" for 127.0.0.1 at 2016-01-24 16:12:23 -0800
Line 67 in drinks_controller.rb:
render layout:'application', text:%q(<ng-include src="'/drinks/edit.html'"></ng-include>)
I got an ActionView::MissingTemplate exception every time Google Favicon crawler tries to get my root url accepting only the image/* format.
The crawler user agent is:
Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google Favicon
I can reproduce this exception with this command:
curl -v -H "Accept: image/*" http://localhost:3000
I'm using a custom layout, named omega (on /layouts/omega path), can this affect the framework like that?
Isn't this a misbehavior?
How can I solve this and serve the favicon?
The error log:
ActionView::MissingTemplate at /
================================
> Missing template /layouts/omega/_index with {:locale=>[:"pt-br", :pt, :en], :formats=>["image/*"], :handlers=>[:erb, :builder, :coffee]}. Searched in:
* "/home/samuel/www/myapp/app/views"
* "/home/samuel/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/kaminari-0.16.3/app/views"
* "/home/samuel/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/declarative_authorization-0.5.7/app/views"
* "/home/samuel/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.4.1/app/views"
* "/home/samuel/www/myapp"
* "/"
app/controllers/properties_controller.rb, line 280
--------------------------------------------------
``` ruby
275 redirect_to root_path, status: :moved_permanently
276 else
> 280 render '/layouts/omega/_index'
282 end
283 end
284 return
285 end
```
App backtrace
-------------
- app/controllers/properties_controller.rb:280:in `show'
Full backtrace
--------------
- actionpack (3.2.22) lib/action_view/path_set.rb:58:in `find'
- actionpack (3.2.22) lib/action_view/lookup_context.rb:122:in `find'
- actionpack (3.2.22) lib/action_view/renderer/abstract_renderer.rb:3:in `find_template'
- actionpack (3.2.22) lib/action_view/renderer/template_renderer.rb:28:in `block in determine_template'
- actionpack (3.2.22) lib/action_view/lookup_context.rb:143:in `with_fallbacks'
- actionpack (3.2.22) lib/action_view/renderer/abstract_renderer.rb:3:in `with_fallbacks'
- actionpack (3.2.22) lib/action_view/renderer/template_renderer.rb:28:in `determine_template'
- actionpack (3.2.22) lib/action_view/renderer/template_renderer.rb:10:in `render'
- actionpack (3.2.22) lib/action_view/renderer/renderer.rb:36:in `render_template'
- actionpack (3.2.22) lib/action_view/renderer/renderer.rb:17:in `render'
- actionpack (3.2.22) lib/abstract_controller/rendering.rb:110:in `_render_template'
- actionpack (3.2.22) lib/action_controller/metal/streaming.rb:225:in `_render_template'
- actionpack (3.2.22) lib/abstract_controller/rendering.rb:103:in `render_to_body'
- actionpack (3.2.22) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
- actionpack (3.2.22) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
- actionpack (3.2.22) lib/abstract_controller/rendering.rb:88:in `render'
- actionpack (3.2.22) lib/action_controller/metal/rendering.rb:16:in `render'
- actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
- activesupport (3.2.22) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
- /home/samuel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
- activesupport (3.2.22) lib/active_support/core_ext/benchmark.rb:5:in `ms'
- actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
- actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
- activerecord (3.2.22) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
- actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:39:in `render'
- app/controllers/properties_controller.rb:280:in `show'
- actionpack (3.2.22) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
- actionpack (3.2.22) lib/abstract_controller/base.rb:167:in `process_action'
- actionpack (3.2.22) lib/action_controller/metal/rendering.rb:10:in `process_action'
- actionpack (3.2.22) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
- activesupport (3.2.22) lib/active_support/callbacks.rb:492:in `block in _run__3499709650331313942__process_action__3074038669074245940__callbacks'
- activesupport (3.2.22) lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_548'
- marginalia (1.3.0) lib/marginalia.rb:77:in `record_query_comment'
- activesupport (3.2.22) lib/active_support/callbacks.rb:214:in `_conditional_callback_around_548'
- activesupport (3.2.22) lib/active_support/callbacks.rb:447:in `_run__3499709650331313942__process_action__3074038669074245940__callbacks'
- activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `__run_callback'
- activesupport (3.2.22) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
- activesupport (3.2.22) lib/active_support/callbacks.rb:81:in `run_callbacks'
- actionpack (3.2.22) lib/abstract_controller/callbacks.rb:17:in `process_action'
- actionpack (3.2.22) lib/action_controller/metal/rescue.rb:29:in `process_action'
- actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
- activesupport (3.2.22) lib/active_support/notifications.rb:123:in `block in instrument'
- activesupport (3.2.22) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
- activesupport (3.2.22) lib/active_support/notifications.rb:123:in `instrument'
- actionpack (3.2.22) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
- actionpack (3.2.22) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
- activerecord (3.2.22) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
- actionpack (3.2.22) lib/abstract_controller/base.rb:121:in `process'
- actionpack (3.2.22) lib/abstract_controller/rendering.rb:45:in `process'
- rack-mini-profiler (0.9.7) lib/mini_profiler/profiling_methods.rb:106:in `block in profile_method'
- actionpack (3.2.22) lib/action_controller/metal.rb:203:in `dispatch'
- actionpack (3.2.22) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
- actionpack (3.2.22) lib/action_controller/metal.rb:246:in `block in action'
- actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
- actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:36:in `call'
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
- journey (1.0.4) lib/journey/router.rb:56:in `call'
- actionpack (3.2.22) lib/action_dispatch/routing/route_set.rb:608:in `call'
- mongoid (2.4.11) lib/rack/mongoid/middleware/identity_map.rb:33:in `block in call'
- mongoid (2.4.11) lib/mongoid.rb:133:in `unit_of_work'
- mongoid (2.4.11) lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
- warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
- warden (1.2.3) lib/warden/manager.rb:34:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
- rack (1.4.7) lib/rack/etag.rb:23:in `call'
- rack (1.4.7) lib/rack/conditionalget.rb:25:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/head.rb:14:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/flash.rb:242:in `call'
- rack (1.4.7) lib/rack/session/abstract/id.rb:210:in `context'
- rack (1.4.7) lib/rack/session/abstract/id.rb:205:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/cookies.rb:341:in `call'
- activerecord (3.2.22) lib/active_record/query_cache.rb:64:in `call'
- activerecord (3.2.22) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
- activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `_run__4348557046124021977__call__3061323192353778014__callbacks'
- activesupport (3.2.22) lib/active_support/callbacks.rb:405:in `__run_callback'
- activesupport (3.2.22) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
- activesupport (3.2.22) lib/active_support/callbacks.rb:81:in `run_callbacks'
- actionpack (3.2.22) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/reloader.rb:65:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
- better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
- railties (3.2.22) lib/rails/rack/logger.rb:32:in `call_app'
- railties (3.2.22) lib/rails/rack/logger.rb:16:in `block in call'
- activesupport (3.2.22) lib/active_support/tagged_logging.rb:22:in `tagged'
- railties (3.2.22) lib/rails/rack/logger.rb:16:in `call'
- quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
- actionpack (3.2.22) lib/action_dispatch/middleware/request_id.rb:22:in `call'
- rack (1.4.7) lib/rack/methodoverride.rb:21:in `call'
- rack (1.4.7) lib/rack/runtime.rb:17:in `call'
- activesupport (3.2.22) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
- rack (1.4.7) lib/rack/lock.rb:15:in `call'
- actionpack (3.2.22) lib/action_dispatch/middleware/static.rb:83:in `call'
- rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
- rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
- rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
- rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
- rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
- honeybadger (2.0.6) lib/honeybadger/rack/error_notifier.rb:33:in `block in call'
- honeybadger (2.0.6) lib/honeybadger/config.rb:189:in `with_request'
- honeybadger (2.0.6) lib/honeybadger/rack/error_notifier.rb:30:in `call'
- honeybadger (2.0.6) lib/honeybadger/rack/user_feedback.rb:29:in `call'
- honeybadger (2.0.6) lib/honeybadger/rack/user_informer.rb:19:in `call'
- rack-mini-profiler (0.9.7) lib/mini_profiler/profiler.rb:276:in `call'
- railties (3.2.22) lib/rails/engine.rb:484:in `call'
- railties (3.2.22) lib/rails/application.rb:231:in `call'
- rack (1.4.7) lib/rack/content_length.rb:14:in `call'
- railties (3.2.22) lib/rails/rack/log_tailer.rb:17:in `call'
- thin (1.6.3) lib/thin/connection.rb:86:in `block in pre_process'
- thin (1.6.3) lib/thin/connection.rb:84:in `pre_process'
- thin (1.6.3) lib/thin/connection.rb:53:in `process'
- thin (1.6.3) lib/thin/connection.rb:39:in `receive_data'
- eventmachine (1.0.7) lib/eventmachine.rb:187:in `run'
- thin (1.6.3) lib/thin/backends/base.rb:73:in `start'
- thin (1.6.3) lib/thin/server.rb:162:in `start'
- rack (1.4.7) lib/rack/handler/thin.rb:13:in `run'
- rack (1.4.7) lib/rack/server.rb:268:in `start'
- railties (3.2.22) lib/rails/commands/server.rb:70:in `start'
- railties (3.2.22) lib/rails/commands.rb:55:in `block in <top (required)>'
- railties (3.2.22) lib/rails/commands.rb:50:in `<top (required)>'
- script/rails:6:in `<main>'
I'm using Ubuntu 15.04. I installed RVM, Ruby 2.2 and Rails 4.2.2. When I create a new project doing rails new blog, when I start the server I get a plain text message saying "Internal Server Error". What's weird is that it's in plain text format.
I can't figure out why. Here's the error log:
Started GET "/" for 127.0.0.1 at 2015-06-18 17:54:17 -0300
ArgumentError (wrong number of arguments (2 for 1)):
actionpack (4.2.2) lib/action_dispatch/http/request.rb:338:in `parse_query'
rack (1.6.3) lib/rack/request.rb:191:in `GET'
actionpack (4.2.2) lib/action_dispatch/http/request.rb:300:in `GET'
actionpack (4.2.2) lib/action_dispatch/http/parameters.rb:14:in `parameters'
actionpack (4.2.2) lib/action_dispatch/http/filter_parameters.rb:37:in `filtered_parameters'
actionpack (4.2.2) lib/action_controller/metal/instrumentation.rb:22:in `process_action'
actionpack (4.2.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.2) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.2) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.2) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.2) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `call'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:819:in `call'
rack (1.6.3) lib/rack/etag.rb:24:in `call'
rack (1.6.3) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.3) lib/rack/head.rb:13:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.3) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.3) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
activerecord (4.2.2) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.1.3) lib/web_console/middleware.rb:37:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.3) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.3) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.3) lib/rack/lock.rb:17:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.3) lib/rack/sendfile.rb:113:in `call'
railties (4.2.2) lib/rails/engine.rb:518:in `call'
railties (4.2.2) lib/rails/application.rb:164:in `call'
rack (1.6.3) lib/rack/lock.rb:17:in `call'
rack (1.6.3) lib/rack/content_length.rb:15:in `call'
rack (1.6.3) lib/rack/handler/webrick.rb:88:in `service'
/home/alepolar/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/home/alepolar/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/home/alepolar/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Rendered /home/alepolar/.rvm/gems/ruby-2.2.2/gems/actionpack-4.2.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (7.5ms)
Started GET "/" for 127.0.0.1 at 2015-06-18 17:54:18 -0300
ArgumentError (wrong number of arguments (2 for 1)):
actionpack (4.2.2) lib/action_dispatch/http/request.rb:338:in `parse_query'
rack (1.6.3) lib/rack/request.rb:191:in `GET'
actionpack (4.2.2) lib/action_dispatch/http/request.rb:300:in `GET'
actionpack (4.2.2) lib/action_dispatch/http/parameters.rb:14:in `parameters'
actionpack (4.2.2) lib/action_controller/metal/instrumentation.rb:22:in `process_action'
actionpack (4.2.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.2) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.2) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.2) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.2) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `call'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:819:in `call'
rack (1.6.3) lib/rack/etag.rb:24:in `call'
rack (1.6.3) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.3) lib/rack/head.rb:13:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.3) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.3) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
activerecord (4.2.2) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.1.3) lib/web_console/middleware.rb:37:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.3) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.3) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.3) lib/rack/lock.rb:17:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.3) lib/rack/sendfile.rb:113:in `call'
railties (4.2.2) lib/rails/engine.rb:518:in `call'
railties (4.2.2) lib/rails/application.rb:164:in `call'
rack (1.6.3) lib/rack/lock.rb:17:in `call'
rack (1.6.3) lib/rack/content_length.rb:15:in `call'
rack (1.6.3) lib/rack/handler/webrick.rb:88:in `service'
/home/alepolar/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/home/alepolar/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/home/alepolar/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Rendered /home/alepolar/.rvm/gems/ruby-2.2.2/gems/actionpack-4.2.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (6.2ms)
Ruby and Rails seems to be installed properly:
alepolar#AleLinux:~/Workspace/blog$ which ruby
/home/alepolar/.rvm/rubies/ruby-2.2.2/bin/ruby
alepolar#AleLinux:~/Workspace/blog$ which rails
/home/alepolar/.rvm/gems/ruby-2.2.2/bin/rails
See https://github.com/rails/rails/issues/20624.
Try reverting to an earlier version of rack by specifying a version in your gemfile and running bundle install.
gem 'rack', '1.6.1'
Here is a hash:
#rolesHash = {:update => {:link => 1, :task => 36}, :delete => {:link => 2, :job => 14}}
I'm getting the following strange characteristics when trying to access it:
#rolesHash[:update].present? # true
#rolesHash[:update].class # Hash
#rolesHash[:update].keys # undefined method nil for nil:NilClass
#rolesHash[:update][:task] # expecting '36' but get undefined method nil for nil:NilClass
Why can't I access this hash properly?
Detail:
Controller:
14: #recruiters = #company.recruiters
15: render layout: 'notice'
View:
<% #recruiters.each do |recruiter| %>
<% #user = User.find_by_roleable_type_and_roleable_id("Recruiter", recruiter.id) %>
<% #rolesHash = {} %>
<% roles = #user.roles.where("user_id = ? AND company_id = ?", #user.id, #company.id) %>
<% roles.each{|r| #rolesHash[r.role.to_sym] ||= {}; #rolesHash[r.role.to_sym][r.roleable_type.to_sym] = r.roleable_id}
...
<%= #rolesHash[:delete][:job] # error
...
<% end %>
Trace
undefined method `[]' for nil:NilClass
Extracted source (around line #148):
147:
148: <%= #rolesHash[:delete][:job] %>
149:
Rails.root: /Users/ss/Documents/ss/app
app/views/recruiters/index.html.erb:148:in `block in _app_views_recruiters_index_html_erb__298609598644026366_70131760233080'
activerecord (3.2.13) lib/active_record/relation/delegation.rb:6:in `each'
activerecord (3.2.13) lib/active_record/relation/delegation.rb:6:in `each'
app/views/recruiters/index.html.erb:134:in `_app_views_recruiters_index_html_erb__298609598644026366_70131760233080'
actionpack (3.2.13) lib/action_view/template.rb:145:in `block in render'
activesupport (3.2.13) lib/active_support/notifications.rb:125:in `instrument'
actionpack (3.2.13) lib/action_view/template.rb:143:in `render'
actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
actionpack (3.2.13) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.13) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:18:in `render'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:154:in `block in render_with_newrelic'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/method_tracer.rb:234:in `trace_execution_scoped'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:153:in `render_with_newrelic'
actionpack (3.2.13) lib/action_view/renderer/renderer.rb:36:in `render_template'
actionpack (3.2.13) lib/action_view/renderer/renderer.rb:17:in `render'
actionpack (3.2.13) lib/abstract_controller/rendering.rb:110:in `_render_template'
actionpack (3.2.13) lib/action_controller/metal/streaming.rb:225:in `_render_template'
actionpack (3.2.13) lib/abstract_controller/rendering.rb:103:in `render_to_body'
actionpack (3.2.13) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
actionpack (3.2.13) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
actionpack (3.2.13) lib/abstract_controller/rendering.rb:88:in `render'
actionpack (3.2.13) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.2.13) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/ss/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (3.2.13) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:39:in `render'
app/controllers/recruiters_controller.rb:15:in `index'
actionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.13) lib/active_support/callbacks.rb:480:in `_run__4384579426478621208__process_action__277342749717267414__callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:32:in `block in process_action'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:365:in `perform_action_with_newrelic_trace'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:31:in `process_action'
actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
omniauth (1.2.2) lib/omniauth/builder.rb:59:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
/Users/ss/.rvm/gems/ruby-2.0.0-p481/bundler/gems/rails-dev-boost-bf49caca6670/lib/rails_development_boost/async.rb:12:in `block in call'
/Users/ss/.rvm/gems/ruby-2.0.0-p481/bundler/gems/rails-dev-boost-bf49caca6670/lib/rails_development_boost/async.rb:39:in `block in synchronize'
/Users/ss/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/ss/.rvm/gems/ruby-2.0.0-p481/bundler/gems/rails-dev-boost-bf49caca6670/lib/rails_development_boost/async.rb:39:in `synchronize'
/Users/ss/.rvm/gems/ruby-2.0.0-p481/bundler/gems/rails-dev-boost-bf49caca6670/lib/rails_development_boost/async.rb:12:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/error_collector.rb:50:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/agent_hooks.rb:26:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/browser_monitoring.rb:23:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__3461156388977909965__call__2048692231345738343__callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rails-dev-tweaks (1.2.0) lib/rails_dev_tweaks/granular_autoload/middleware.rb:36:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
request_store (1.1.0) lib/request_store/middleware.rb:8:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (3.2.13) lib/rails/engine.rb:479:in `call'
railties (3.2.13) lib/rails/application.rb:223:in `call'
railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
newrelic_rpm (3.9.4.245) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
thin (1.6.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.2) lib/thin/connection.rb:84:in `catch'
thin (1.6.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.2) lib/thin/connection.rb:53:in `process'
thin (1.6.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.2) lib/thin/backends/base.rb:73:in `start'
thin (1.6.2) lib/thin/server.rb:162:in `start'
rack (1.4.5) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.5) lib/rack/server.rb:268:in `start'
railties (3.2.13) lib/rails/commands/server.rb:70:in `start'
railties (3.2.13) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.13) lib/rails/commands.rb:50:in `tap'
railties (3.2.13) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:7:in `require'
script/rails:7:in `<main>'
I guess that your call to #user.roles.where("user_id = ? AND company_id = ?", #user.id, #company.id) returns no rows. This would cause roles to be empty, which in turn means roles.each doesn't iterate over anything and the block is never called.
Thus, when you reach
<%= #rolesHash[:delete][:job]
#rolesHash is still {}, and the line is going to fail with the error you've pasted.
To verify this I would start by adding two debug lines in your output. One right before iterating:
<% Rails.logger.debug roles.inspect %>
<% roles.each{|r| #rolesHash[r.role.to_sym] ||= {}; #rolesHash[r.role.to_sym][r.roleable_type.to_sym] = r.roleable_id}
and one right before accessing #rolesHash:
<% Rails.logger.debug #rolesHash.inspect %>
<%= #rolesHash[:delete][:job] %>
Then, looking in your logfile should allow you to see if the actual data matches the data you expect to be present.