I am running a rails app and I have a simple show action, where the code is something like the following:
#post = Post.find(params[:id])
So if you go to posts/1 for example you will see the post if there is one.
I can catch invalid params[:id] or invalid params but I noticed something strange. Somebody tried to pass me yesterday something like the following:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED%E5;
And I am getting an ActionController bad request exception. When I am visiting the url /posts/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED%E5; I see a blank page instead of the typical 404 I have in a similar error. I also noticed that with the param it doesn't get into posts controller show action, either to application controller (I've tried to rescue it from there as well). I suppose it is a rack exception from some gem I have and I don't know how to rescue it.
Here is my whole error response:
Started GET "/blog/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Result:+%ED" for 192.168.1.105 at 2014-03-18 09:45:42 +0200
ActionController::BadRequest (ActionController::BadRequest):
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:37:in `block in call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:33:in `each'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:33:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
bullet (4.7.1) lib/bullet/rack.rb:12: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 `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__44017112__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (1.1.0) lib/better_errors/middleware.rb:58:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.7.1) lib/puma/server.rb:486:in `handle_request'
puma (2.7.1) lib/puma/server.rb:357:in `process_client'
puma (2.7.1) lib/puma/server.rb:250:in `block in run'
puma (2.7.1) lib/puma/thread_pool.rb:92:in `call'
puma (2.7.1) lib/puma/thread_pool.rb:92:in `block in spawn_thread'
Any idea how can I rescue this one with a 404 and avoid the blank page?
OK I found that if you pass something like %ED it is a 400 bad request so I just created a 400 static page and I've added the following in my exception notification:
Myapp::Application.config.middleware.use ExceptionNotification::Rack,
:ignore_exceptions => ['ActionController::BadRequest'] + ExceptionNotifier.ignored_exceptions,
:ignore_crawlers => %w{Googlebot bingbot},
:email => {
:email_prefix => "[Myapp.com Exception Notifier] ",
:sender_address => %{"myapp.com" <info#myapp.com>},
:exception_recipients => %w{myemail#myapp.com}
}
Related
I'm just adding the gem to the gemfile and writing to the js console:
MessageBus.subscribe('/my_channel', function(data){
alert(data);
});
it throws:
Started POST "/message-bus/4700f3c66b254e31875de6caeba011df/poll" for 127.0.0.1 at 2016-04-11 11:32:49 -0300
** [Airbrake] Notice was not sent due to configuration:
Environment Monitored? false
API key set? false
NotImplementedError (only partial hijack is supported.):
rack (1.6.4) lib/rack/handler/webrick.rb:76:in `block in service'
/home/alter/.rvm/gems/ruby-2.2.2#project/bundler/gems/message_bus-7a93b755b456/lib/message_bus/rack/middleware.rb:141:in `call'
/home/alter/.rvm/gems/ruby-2.2.2#project/bundler/gems/message_bus-7a93b755b456/lib/message_bus/rack/middleware.rb:141: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.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.1) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
activerecord (4.2.1) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.1) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
activesupport (4.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
airbrake (4.3.6) lib/airbrake/rails/middleware.rb:13:in `call'
actionpack (4.2.1) 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.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.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.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.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.1) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
airbrake (4.3.6) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (4.3.6) lib/airbrake/user_informer.rb:12:in `call'
railties (4.2.1) lib/rails/engine.rb:518:in `call'
railties (4.2.1) lib/rails/application.rb:164: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'
/home/alter/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/home/alter/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/home/alter/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Rendered /home/alter/.rvm/gems/ruby-2.2.2#project/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (1.5ms)
Rendered /home/alter/.rvm/gems/ruby-2.2.2#project/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (0.4ms)
Rendered /home/alter/.rvm/gems/ruby-2.2.2#project/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (0.6ms)
Rendered /home/alter/.rvm/gems/ruby-2.2.2#project/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb (14.4ms)
I'm basing on master for this:
GIT
remote: git://github.com/SamSaffron/message_bus.git
revision: 7a93b755b4568becb3ef87ed8053aa3e4c5346a4
branch: master
specs:
message_bus (2.0.0.beta.6)
rack (>= 1.1.3)
I was using webrick locally. I just added gem 'puma' to the group :development of my Gemfile and that fixed the problem.
I am currently use a rails starter kit for a project which can be found here.This allows for a simple login, home page, monitoring, etc. This starter kit uses rails 4.1.8 and ruby 2.1.3.
I am currently now trying to get the a dashboard gem to work called dashing rails. It's compatible with rails 4.0 and ruby 2.0.
I allowed authorization to my localhost by adding the appropriate path for it. I am able to get the page to show, however when I load the page it comes out incomplete but sometimes it's different. Below is a picture with the buzzwords and convergence incomplete. They should have more information in them. This package using active support and requires redis server. It also requires multiple threads.
Yes I did try the curl command.
The problem I believe has to do with some dependency issue, as stated by the log, but I am new to rails so any help with trying to resolve this issue or the cause would be greatly appreciated. Thank you!
Here is the error file
RuntimeError (Circular dependency detected while autoloading constant Dashing::WidgetsController):
activesupport (4.1.8) lib/active_support/dependencies.rb:478:in `load_missing_constant'
activesupport (4.1.8) lib/active_support/dependencies.rb:180:in `const_missing'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:240:in `const_get'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:240:in `block in constantize'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `each'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `inject'
activesupport (4.1.8) lib/active_support/inflector/methods.rb:236:in `constantize'
activesupport (4.1.8) lib/active_support/dependencies.rb:552:in `get'
activesupport (4.1.8) lib/active_support/dependencies.rb:583:in `constantize'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:78:in `controller_reference'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:68:in `controller'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:46:in `call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in `call'
railties (4.1.8) lib/rails/engine.rb:514:in `call'
railties (4.1.8) lib/rails/railtie.rb:194:in `public_send'
railties (4.1.8) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.8) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.8) lib/action_dispatch/routing/route_set.rb:678:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack-pjax (0.8.0) lib/rack/pjax.rb:12:in `call'
newrelic_rpm (3.9.8.273) 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.8.273) 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.8.273) 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.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/rack/browser_monitoring.rb:23:in `traced_call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:55: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 `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/flash.rb:254:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/cookies.rb:560:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/query_cache.rb:36:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activerecord (4.1.8) lib/active_record/migration.rb:380:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.8) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/reloader.rb:73:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (3.2.1) lib/airbrake/rails/middleware.rb:13:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.8) lib/rails/rack/logger.rb:22:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
activesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
actionpack (4.1.8) lib/action_dispatch/middleware/static.rb:84:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
airbrake (3.2.1) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (3.2.1) lib/airbrake/user_informer.rb:12:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
railties (4.1.8) lib/rails/engine.rb:514:in `call'
railties (4.1.8) lib/rails/application.rb:144:in `call'
newrelic_rpm (3.9.8.273) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.10.2) lib/puma/server.rb:492:in `handle_request'
puma (2.10.2) lib/puma/server.rb:363:in `process_client'
puma (2.10.2) lib/puma/server.rb:254:in `block in run'
puma (2.10.2) lib/puma/thread_pool.rb:101:in `call'
puma (2.10.2) lib/puma/thread_pool.rb:101:in `block in spawn_thread'
I am using Omniauth gem for logging in through my website via google in Ruby on Rails. I am using Omnicontacts gem for fetching the contacts. I am getting the following error if there is no current user and New user who has not authorised our site is trying to login.
TypeError (no implicit conversion of String into Integer):
omnicontacts (0.3.4) lib/omnicontacts/importer/gmail.rb:64:in `[]'
omnicontacts (0.3.4) lib/omnicontacts/importer/gmail.rb:64:in `block in contacts_from_response'
omnicontacts (0.3.4) lib/omnicontacts/importer/gmail.rb:41:in `each'
omnicontacts (0.3.4) lib/omnicontacts/importer/gmail.rb:41:in `contacts_from_response'
omnicontacts (0.3.4) lib/omnicontacts/importer/gmail.rb:24:in `fetch_contacts_using_access_token'
omnicontacts (0.3.4) lib/omnicontacts/middleware/oauth2.rb:52:in `fetch_contacts'
omnicontacts (0.3.4) lib/omnicontacts/middleware/base_oauth.rb:66:in `block in handle_callback'
omnicontacts (0.3.4) lib/omnicontacts/middleware/base_oauth.rb:76:in `execute_and_rescue_exceptions'
omnicontacts (0.3.4) lib/omnicontacts/middleware/base_oauth.rb:62:in `handle_callback'
omnicontacts (0.3.4) lib/omnicontacts/middleware/base_oauth.rb:39:in `call'
omnicontacts (0.3.4) lib/omnicontacts/builder.rb:27: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 `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.1) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.1) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.1) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.1) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.1) lib/rails/engine.rb:514:in `call'
railties (4.1.1) lib/rails/application.rb:144:in `call'
passenger (4.0.46) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
passenger (4.0.46) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
passenger (4.0.46) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
passenger (4.0.46) lib/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'
This is a known issue in omnicontacts gem. Please see this url https://github.com/Diego81/omnicontacts/issues/71. Solution also there.
I appreciate that this is a very common error in Ruby. I've just started learning Ruby on Rails but I've gathered that this basically comes from passing the wrong number of arguments to a method.
I was reading through the Ruby docs and it seems that the standard way to have your root path is to have a PagesController with a main view. In "routes.rb" I have:
root to: 'pages#main'
This is my PagesController:
class PagesController < ApplicationController
def main
end
end
From my understanding, main is the default route, which I am trying to access. I have a main method which doesn't take any parameters but somehow it is being passed one. Where am I going wrong here?
Errors:
ArgumentError in PagesController#main
wrong number of arguments(1 for 0)
Rails.root: C:/RubymineProjects/ShoppingApp
Full Trace:
actionpack (4.0.1) lib/abstract_controller/base.rb:89:in `initialize'
actionpack (4.0.1) lib/abstract_controller/base.rb:89:in `new'
actionpack (4.0.1) lib/abstract_controller/base.rb:89:in `action_methods'
actionpack (4.0.1) lib/action_controller/metal/hide_actions.rb:36:in `action_methods'
actionpack (4.0.1) lib/abstract_controller/url_for.rb:25:in `action_methods'
actionpack (4.0.1) lib/abstract_controller/base.rb:179:in `action_method?'
actionpack (4.0.1) lib/abstract_controller/base.rb:230:in `method_for_action'
actionpack (4.0.1) lib/action_controller/metal/hide_actions.rb:17:in `method_for_action'
actionpack (4.0.1) lib/action_controller/metal/implicit_render.rb:14:in `method_for_action'
actionpack (4.0.1) lib/abstract_controller/base.rb:130:in `process'
actionpack (4.0.1) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.1) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.1) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.1) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.1) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.1) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:680:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.1) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.1) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.1) lib/active_support/callbacks.rb:373:in `_run__897547547__call__callbacks'
activesupport (4.0.1) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.1) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.1) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.1) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.1) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.1) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.1) lib/rails/engine.rb:511:in `call'
railties (4.0.1) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
C:/Ruby193/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
does
root 'pages#main'
solve the problem? (In rails 4, the documentations don't mention a "to:")
I had the same issue.
Except for me I was using a rails word that I shouldn't have been using.
In my routes.rb file:
root :to => 'static#main'
and I got the same error as you.
in static_controller.rb I had
class StaticController < ApplicationController
def main
end
def blog
end
def about
end
def process
end
end
the problem was the method named process. I changed it to myprocess and everything worked.
Rails is like your significant other. Really annoying and frustrating when there's something wrong but they won't tell you what, but incredibly awesome and fantastic when everything goes the way it should.
I just upgraded to rails 3.2.0.rc1 and i tried signing it with devise and it worked very well but if i try signing in with an invalid account i get the following error message undefined method split for :failure:Symbol
this is my server report
Completed 401 Unauthorized in 170ms
NoMethodError (undefined method `split' for :failure:Symbol):
devise (1.5.3) lib/devise/failure_app.rb:119:in `recall_app'
devise (1.5.3) lib/devise/failure_app.rb:46:in `recall'
devise (1.5.3) lib/devise/failure_app.rb:30:in `respond'
actionpack (3.2.0.rc1) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.0.rc1) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.0.rc1) lib/action_controller/metal.rb:199:in `dispatch'
actionpack (3.2.0.rc1) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.0.rc1) lib/action_controller/metal.rb:242:in `block in action'
devise (1.5.3) lib/devise/failure_app.rb:19:in `call'
devise (1.5.3) lib/devise/failure_app.rb:19:in `call'
devise (1.5.3) lib/devise/delegator.rb:5:in `call'
warden (1.1.0) lib/warden/manager.rb:121:in `call_failure_app'
warden (1.1.0) lib/warden/manager.rb:107:in `process_unauthenticated'
warden (1.1.0) lib/warden/manager.rb:47:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.5) lib/rack/etag.rb:23:in `call'
rack (1.3.5) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.0.rc1) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:395:in `_run_call_callbacks'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/reloader.rb:63:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.0.rc1) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.0.rc1) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.0.rc1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.0.rc1) lib/rails/engine.rb:479:in `call'
rack (1.3.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.0.rc1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.5) lib/rack/handler/webrick.rb:59:in `service'
/home/rzaartz/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rzaartz/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rzaartz/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Rendered /home/rzaartz/.rvm/gems/ruby-1.9.2-p180#rub/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (3.4ms)
Rendered /home/rzaartz/.rvm/gems/ruby-1.9.2-p180#rub/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.1ms)
Rendered /home/rzaartz/.rvm/gems/ruby-1.9.2-p180#rub/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (9.2ms)