我在rails中遇到Twilio gem的问题,我正在通过Twilio教程https://www.twilio.com/blog/2014/10/twilio-on-rails-part-2-rails-4-app-sending-sms-mms.html完成所有工作,当我需要在控制台中输入此命令时,我在第二部分遇到错误:
curl --data "foo=bar" http://localhost:3000/notifications/notify
我在服务器日志中看到了这个:
Started POST "/notifications/notify" for 127.0.0.1 at 2015-04-21 13:39:49 +0300
ActionController::RoutingError (uninitialized constant NotificationsController):
activesupport (4.1.6) lib/active_support/inflector/methods.rb:238:in `const_get'
activesupport (4.1.6) lib/active_support/inflector/methods.rb:238:in `block in constantize'
activesupport (4.1.6) lib/active_support/inflector/methods.rb:236:in `each'
activesupport (4.1.6) lib/active_support/inflector/methods.rb:236:in `inject'
activesupport (4.1.6) lib/active_support/inflector/methods.rb:236:in `constantize'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:78:in `controller_reference'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:68:in `controller'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:46:in `call'
actionpack (4.1.6) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.6) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.6) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:678:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:35:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.6) 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.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.6) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.6) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.6) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.6) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.6) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.6) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.6) 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.6) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.6) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.6) lib/rails/engine.rb:514:in `call'
railties (4.1.6) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/content_length.rb:14: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 `catch'
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_machine'
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.5.2) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.2) lib/rack/server.rb:264:in `start'
railties (4.1.6) lib/rails/commands/server.rb:69:in `start'
railties (4.1.6) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.6) lib/rails/commands/commands_tasks.rb:76:in `tap'
railties (4.1.6) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.6) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.6) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:8:in `require'
bin/rails:8:in `<top (required)>'
spring (1.3.3) lib/spring/client/rails.rb:27:in `load'
spring (1.3.3) lib/spring/client/rails.rb:27:in `call'
spring (1.3.3) lib/spring/client/command.rb:7:in `call'
spring (1.3.3) lib/spring/client.rb:26:in `run'
spring (1.3.3) bin/spring:48:in `<top (required)>'
spring (1.3.3) lib/spring/binstub.rb:11:in `load'
spring (1.3.3) lib/spring/binstub.rb:11:in `<top (required)>'
bin/spring:13:in `require'
bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Rendered /Users/elksomik/.rvm/gems/ruby-2.2.0@my_ex/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.3ms)
Rendered /Users/elksomik/.rvm/gems/ruby-2.2.0@my_ex/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (7.4ms)
Rendered /Users/elksomik/.rvm/gems/ruby-2.2.0@my_ex/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.2ms)
Rendered /Users/elksomik/.rvm/gems/ruby-2.2.0@my_ex/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (131.4ms)