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.
Related
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>)
Apologies for vague title. I am following https://www.railstutorial.org/book/beginning#cha-beginning tutorial to learn RoR on cloud9. I have made the changes in my controller as listed in chapter 1, heading 1.4
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
def hello
render text: "hello, world!"
end
end
and my routes.rb file
Rails.application.routes.draw do
root 'application#hello'
end
But when i restart the server, I gett error
Started GET "/" for 69.157.46.139 at 2015-12-03 21:20:46 +0000
AbstractController::ActionNotFound (The action 'hello' could not be found for ApplicationController):
actionpack (4.2.2) lib/abstract_controller/base.rb:132: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.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.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.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.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'
web-console (2.0.0.beta3) lib/action_dispatch/debug_exceptions.rb:18:in `middleware_call'
web-console (2.0.0.beta3) lib/action_dispatch/debug_exceptions.rb:13: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.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) 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.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.4) 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.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'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Rendered /usr/local/rvm/gems/ruby-2.2.1/gems/web-console-2.0.0.beta3/lib/action_dispatch/templates/rescues/unknown_action.html.erb within rescues/layout (9.6ms)
Started GET "/" for 69.157.46.139 at 2015-12-03 21:21:46 +0000
AbstractController::ActionNotFound (The action 'hello' could not be found for ApplicationController):
actionpack (4.2.2) lib/abstract_controller/base.rb:132: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.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.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.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.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'
web-console (2.0.0.beta3) lib/action_dispatch/debug_exceptions.rb:18:in `middleware_call'
web-console (2.0.0.beta3) lib/action_dispatch/debug_exceptions.rb:13: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.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) 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.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.4) 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.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'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Rendered /usr/local/rvm/gems/ruby-2.2.1/gems/web-console-2.0.0.beta3/lib/action_dispatch/templates/rescues/unknown_action.html.erb within rescues/layout (0.6ms)
I have already tried root to: 'application#hello' and it still didn't work
The application controller is not for defining actions. This is the base controller where likely other controllers should inherit behavior/properties from. You should create another controller and define hello there.
using generator
rails g controller Welcome hello
routes file
root Welcome#hello
get 'hello' => 'welcome#hello'
app/controllers/welcome_controller.rb
class WelcomeController < ApplicationController
def hello
end
end
Thanks all. The problem is with Cloud9 IDE. I did save the application_controller after creating the hello method but IDE wasn't saving it untill i explicitly clicked on File > Save. I figured it out when i cat application_Controller.rb and noticed that hello method doesn't exist there.
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'
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}
}
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)