2013-04-23 29 views
1

在我的應用程序暫存環境中,當我嘗試通過https訪問頁面時,出現錯誤,網頁正確使用http。我得到的錯誤是:使用https時未定義字符串'each'

undefined method `each' for #<String:0x00000009371f28> 

它失敗是在上線日創業板架的地方:

body.each { |part| parts << part } 

def digest_body(body) 
    parts = [] 
    body.each { |part| parts << part } 
    string_body = parts.join 
    digest = Digest::MD5.hexdigest(string_body) unless string_body.empty? 
    [digest, parts] 
end 

看來,他不能處理通過的身體。我檢查了body,它是一個包含我的頁面所有html代碼的字符串。該參數的數據類型應該是一個數組。

"<!DOCTYPE html>\n<html class='no-js' lang='fr' xml:lang='fr'>\n<head>\n<meta charset='utf-8'>\n<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>\n<meta content='width=device-width' name='viewport'>\n<title>Bienvenue sur Zurban Culture | Admin Panel | Zurban Culture</title>\n<meta content=\"authenticity_token\" name=\"csrf-param\" />\n<meta content=\"fEVrJPyUwdf4FZ2GSWW/p01SrByXlJpq+xSbAXOkxBg=\" name=\"csrf-token\" />\n<!--[if lt IE 9]>\n<script src='http://html5shim.googlecode.com/svn/trunk/html5.js' type='text/javascript'></script>\n<![endif]-->\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" type=\"text/javascript\"></script>\n<link href=\"/assets/admin/admin-6033541466a41863e188a9fa9e0ea9bd.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"/assets/admin/print-088f5bc50dba980c42676157c724ed0a.css\" media=\"print\" rel=\"stylesheet\" type=\"text/css\" />\n\n<script src='https://www.google.com/jsapi' type='text/javascript'></script>\n\n<link href='/favicon.ico' rel='shortcut icon'>\n</head>\n<body data-offset='50' data-spy='scroll' id='admin_show'>\n<h1 class='hidden print'>\nZurban Culture\n</h1>\n<div class='navbar navbar-fixed-top noPrint'>\n<div class='navbar-inner'>\n<div class='container-fluid'>\n<a class='btn btn-navbar' data-target='.nav-collapse' data-toggle='collapse'>\n<span class='icon-bar'></span>\n<span class='icon-bar'></span>\n<span class='icon-bar'></span>\n</a>\n<a class='brand' href='/admin'>Zurban Culture</a>\n<div class='nav-collapse'>\n<ul class='nav' id='tabbedInterface'>\n<li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Produits<b class=\"caret\"></b></a><ul class='dropdown-menu'>\n<li><a href=\"https://beta.jeansattitude.fr/admin/products\">Tous produits (4064)</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/products/incomplete\">Brouillons (156)</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/products/deleted\">Effacés (274)</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/purchases\">Bons</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/product_types\">Familles (24)</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/products/maintenance\">Maintenance</a></li>\n</ul>\n</li><li class=\"brands_tab\"><a href=\"https://beta.jeansattitude.fr/admin/brands\">Marques</a></li>\n<li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Ventes & Marketing<b class=\"caret\"></b></a><ul class='dropdown-menu'>\n<li><a href=\"https://beta.jeansattitude.fr/admin/sales\">En vente (3905)</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/sales/incomplete\">Brouillons (142)</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/sales/new\">Planning (0)</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/sales/planned\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.menu.sales.planned\">Planned</span></a></li>\n<li><a href=\"/admin/discounts\">Codes promotionnels (27)</a></li>\n<li><a href=\"/admin/sales/dashboard\">Page d&#x27;accueil</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/campaigns\">Collections</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/gift_cards/active_not_used\">Chèques cadeaux</a></li>\n<li><a href=\"https://beta.jeansattitude.fr/admin/cheques\">Chèques</a></li>\n</ul>\n</li><li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Commandes<b class=\"caret\"></b></a><ul class='dropdown-menu'>\n<li><a href=\"/admin/orders/pending\">En attente (0)</a></li>\n<li><a href=\"/admin/orders/fraud_review\">A vérifier (3)</a></li>\n<li><a href=\"/admin/orders/paid\">Payées (7)</a></li>\n<li><a href=\"/admin/orders/processing\">Traitement (0)</a></li>\n<li><a href=\"/admin/orders/shipped\">Envoyées (307)</a></li>\n<li><a href=\"/admin/orders/completed\">Complètée (9205)</a></li>\n<li><a href=\"/admin/orders/unavailable_hold\">Indisponible (1)</a></li>\n<li><a href=\"/admin/orders/cancelled\">Annulées (8736)</a></li>\n<li><a href=\"/admin/orders/fraud\">Fraudes (12)</a></li>\n<li><a href=\"/admin/order_transactions\">Tentatives de paiements</a></li>\n</ul>\n</li><li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Retours<b class=\"caret\"></b></a><ul class='dropdown-menu'>\n<li><a href=\"/admin/returns/pending\">En attente (77)</a></li>\n<li><a href=\"/admin/returns/received\">Réceptionné (23)</a></li>\n<li><a href=\"/admin/returns/completed\">Remboursé (1115)</a></li>\n<li><a href=\"/admin/returns/cancelled\">Procédure annulée (4)</a></li>\n</ul>\n</li><li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Avis <b class=\"caret\"></b></a><ul class='dropdown-menu'>\n<li><a href=\"/admin/reviews/needs_approvement\">À approuver (0)</a></li>\n<li><a href=\"/admin/reviews/approved\">Approuvés (3)</a></li>\n<li><a href=\"/admin/reviews/refused\">Refusés (0)</a></li>\n<li><a href=\"/admin/reviews/deleted\">Effacés (0)</a></li>\n</ul>\n</li><li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Utilisateurs<b class=\"caret\"></b></a><ul class='dropdown-menu'>\n<li><a href=\"/admin/users\">Utilisateurs</a></li>\n<li><a href=\"/admin/users/deleted\">Utilisateurs effacés</a></li>\n<li><a href=\"/admin/invitations\">Invitations</a></li>\n</ul>\n</li><li class=\"help_sections_tab\"><a href=\"https://beta.jeansattitude.fr/admin/help_sections\">Sections d&#x27;aide</a></li>\n<li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><img alt=\"Icon_stats\" src=\"/assets/admin/icon_stats-3905dbfb6e4ba900e54d7c49d67f5c49.png\" /><b class=\"caret\"></b></a><ul class='dropdown-menu'>\n<li>\n<a href=\"http://stats.zurbanculture.fr\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.overview\">Overview</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/products\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.products\">Products</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/orders\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.orders\">Orders</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/returns\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.returns\">Returns</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/users\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.users\">Users</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/sales_report\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.sales_report\">Sales Report</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/stock_by_brand\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.stock_report\">Stock Report</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/purchases\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.purchase_report\">Purchase Report</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/statistics/general\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.sales_history\">Sales History</span></a>\n</li>\n<li>\n<a href=\"http://stats.zurbanculture.fr/favorites\"><span class=\"translation_missing\" title=\"translation missing: fr.admin.submenu.favorites\">Favorites</span></a>\n</li>\n</ul>\n</li></ul>\n\n<ul class='nav pull-right'>\n<li class='searchbox'>\n<form accept-charset=\"UTF-8\" action=\"/admin/search\" class=\"navbar-search pull-right\" method=\"get\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div>\n<input class=\"search-query span2\" id=\"query\" name=\"query\" size=\"20\" type=\"text\" value=\"Rechercher\" />\n\n</form>\n\n</li>\n<li class='dropdown'>\n<a class='dropdown-toggle' data-toggle='dropdown' href='#'>\n<i class='icon-user icon-white'></i>\n</a>\n<ul class='dropdown-menu'>\n<li>\n<a href=\"/\">Zurban Culture</a>\n</li>\n<li>\n<a href=\"/logout\">Déconnexion</a>\n</li>\n</ul>\n</li>\n</ul>\n\n</div>\n</div>\n</div>\n</div>\n<div class='container-fluid noPrint'>\n<div class='subnav'>\n<ul class='nav nav-pills'>\n<li class=\"active\"><a href=\"/admin\">Statistique rapides</a></li>\n<li><a href=\"/admin/maintenances\">Logs</a></li>\n</ul>\n\n</div>\n<div class='notices_wrapper noPrint'>\n<div class='row-fluid'>\n<div class='span12'>\n\n</div>\n</div>\n</div>\n</div>\n<div class='container-fluid'>\n<div class='row-fluid'>\n<div class='span12'>\n<div class=\"page-header\">\n <h1>Bienvenue sur Zurban Culture</h1> \n</div>\n\n\n <form accept-charset=\"UTF-8\" action=\"https://beta.jeansattitude.fr/admin\" class=\"well\" method=\"get\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div>\n <input class=\"datepicker onChangeSubmit\" id=\"start_date\" length=\"8\" name=\"start_date\" placeholder=\"Start Date\" type=\"text\" value=\"2013-04-01\" />\n <input class=\"datepicker onChangeSubmit\" id=\"end_date\" length=\"8\" name=\"end_date\" placeholder=\"End Date\" type=\"text\" value=\"2013-04-23\" />\n <input type=\"submit\" class=\"btn\">\n </form>\n <div class=\"row-fluid\">\n <div class=\"section dashboard span6\" id=\"orders_section\">\n <div class=\"well\">\n <h2 class=\"sectionHeader\">Montant des ventes cumulés</h2>\n <div id=\"ordersChart\" class=\"graph\" style=\"width: 95%; height: 300px; margin: 0; padding: 0\"></div>\n </div>\n </div>\n <div class=\"section dashboard span6\" id=\"revenue_section\">\n <div class=\"well\">\n <h2 class=\"sectionHeader\">Montant des ventes</h2>\n <div id=\"revenueChart\" class=\"graph\" style=\"width: 95%; height: 300px; margin: 0; padding: 0\"></div>\n </div>\n </div>\n </div>\n\n <div class=\"row-fluid\">\n <div class=\"section dashboard span6\" id=\"orders_shipped_section\">\n <div class=\"well\">\n <h2 class=\"sectionHeader\">Commandes Expédiées</h2>\n <div id=\"shippedOrdersChart\" class=\"graph\" style=\"width: 95%; height: 300px; margin: 0; padding: 0\"></div>\n </div>\n </div>\n\n <div class=\"section dashboard span6\" id=\"users_section\">\n <div class=\"well\">\n <h2 class=\"sectionHeader\">Nouveaux utilisateurs confirmés</h2>\n <div id=\"usersChart\" class=\"graph\" style=\"width: 95%; height: 300px; margin: 0; padding: 0\"></div>\n </div>\n </div>\n </div>\n\n\n <div id=\"revenueChart\"></div>\n<script type=\"text/javascript\" src=\"http://www.google.com/jsapi\"></script>\n<script type=\"text/javascript\">\nvar rgviz_revenueChart = null;\nvar rgviz_revenueChart_data = null;\nfunction rgviz_draw_revenueChart() {\n var query = new google.visualization.Query('http://stats.zurbanculture.fr/orders/datasource');\n var q = 'select toDate(`paid_at`), `old_members`, `new_members` where ((`state` = \"paid\" or `state` = \"processing\" or `state` = \"shipped\" or `state` = \"completed\") and `paid_at` >= \"2013-04-01\" and `paid_at` <= \"2013-04-24\") group by toDate(`paid_at`) order by toDate(`paid_at`) asc label toDate(`paid_at`) \\'Date\\', `old_members` \\'Ventes Anciens Utilisateurs\\', `new_members` \\'Ventes Nouveaux Utilisateurs\\'';\n query.setQuery(q);\n query.send(function(response) {\n rgviz_revenueChart = new google.visualization.ColumnChart(document.getElementById('revenueChart'));\n rgviz_revenueChart_data = response.getDataTable();\n rgviz_revenueChart_options = {\"is3D\":true,\"width\":\"100%\",\"height\":\"80%\",\"legend\":{\"position\":\"bottom\",\"textStyle\":{\"fontSize\":12}},\"chartArea\":{\"left\":70,\"top\":30,\"width\":\"85%\",\"height\":\"75%\"},\"isStacked\":true};\n rgviz_revenueChart.draw(rgviz_revenueChart_data, rgviz_revenueChart_options);\n});\n}\ngoogle.load(\"visualization\", \"1\", {'packages':['corechart']});\ngoogle.setOnLoadCallback(rgviz_draw_revenueChart);\n</script>\n\n\n <div id=\"ordersChart\"></div>\n<script type=\"text/javascript\">\nvar rgviz_ordersChart = null;\nvar rgviz_ordersChart_data = null;\nfunction rgviz_draw_ordersChart() {\n var query = new google.visualization.Query('http://stats.zurbanculture.fr/orders/datasource');\n var q = 'select toDate(`paid_at`), sum(`total`) where ((`state` = \"paid\" or `state` = \"processing\" or `state` = \"shipped\" or `state` = \"completed\") and `paid_at` >= \"2013-04-01\" and `paid_at` <= \"2013-04-24\") group by toDate(`paid_at`) order by toDate(`paid_at`) asc label toDate(`paid_at`) \\'Date\\', sum(`total`) \\'Montant Ventes\\'';\n query.setQuery(q);\n query.send(function(response) {\n rgviz_ordersChart = new google.visualization.ColumnChart(document.getElementById('ordersChart'));\n rgviz_ordersChart_data = response.getDataTable();\n rgviz_ordersChart_options = {\"is3D\":true,\"width\":\"100%\",\"height\":\"80%\",\"legend\":\"none\",\"chartArea\":{\"left\":70,\"top\":30,\"width\":\"85%\",\"height\":\"75%\"}};\n rgviz_ordersChart.draw(rgviz_ordersChart_data, rgviz_ordersChart_options);\n});\n}\ngoogle.setOnLoadCallback(rgviz_draw_ordersChart);\n</script>\n\n <div id=\"shippedOrdersChart\"></div>\n<script type=\"text/javascript\">\nvar rgviz_shippedOrdersChart = null;\nvar rgviz_shippedOrdersChart_data = null;\nfunction rgviz_draw_shippedOrdersChart() {\n var query = new google.visualization.Query('http://stats.zurbanculture.fr/orders/datasource');\n var q = 'select toDate(`shipped_at`), count(`id`) where ((`state` = \"paid\" or `state` = \"processing\" or `state` = \"shipped\" or `state` = \"completed\") and `shipped_at` >= \"2013-04-01\" and `paid_at` <= \"2013-04-24\") group by toDate(`shipped_at`) order by toDate(`shipped_at`) asc label toDate(`shipped_at`) \\'Date\\', count(`id`) \\'Commandes Expédiées\\'';\n query.setQuery(q);\n query.send(function(response) {\n rgviz_shippedOrdersChart = new google.visualization.AreaChart(document.getElementById('shippedOrdersChart'));\n rgviz_shippedOrdersChart_data = response.getDataTable();\n rgviz_shippedOrdersChart_options = {\"is3D\":true,\"width\":\"100%\",\"height\":\"80%\",\"legend\":\"none\",\"chartArea\":{\"left\":70,\"top\":30,\"width\":\"85%\",\"height\":\"75%\"}};\n rgviz_shippedOrdersChart.draw(rgviz_shippedOrdersChart_data, rgviz_shippedOrdersChart_options);\n});\n}\ngoogle.setOnLoadCallback(rgviz_draw_shippedOrdersChart);\n</script>\n\n <div id=\"usersChart\"></div>\n<script type=\"text/javascript\">\nvar rgviz_usersChart = null;\nvar rgviz_usersChart_data = null;\nfunction rgviz_draw_usersChart() {\n var query = new google.visualization.Query('http://stats.zurbanculture.fr/users/datasource');\n var q = 'select concat(month(`created_at`), \" \", year(`created_at`)), `seo`, `organique` where (`created_at` >= \"2012-04-23\" and `created_at` <= \"2013-04-24\" and `confirmed` = 1) group by concat(month(`created_at`), \" \", year(`created_at`)) order by `created_at` asc label concat(month(`created_at`), \" \", year(`created_at`)) \\'Month\\', `seo` \\'SEO\\', `organique` \\'Organique\\'';\n query.setQuery(q);\n query.send(function(response) {\n rgviz_usersChart = new google.visualization.LineChart(document.getElementById('usersChart'));\n rgviz_usersChart_data = response.getDataTable();\n rgviz_usersChart_options = {\"is3D\":true,\"width\":\"100%\",\"height\":\"80%\",\"legend\":{\"position\":\"bottom\",\"textStyle\":{\"fontSize\":12}},\"chartArea\":{\"left\":70,\"top\":30,\"width\":\"85%\",\"height\":\"75%\"}};\n rgviz_usersChart.draw(rgviz_usersChart_data, rgviz_usersChart_options);\n});\n}\ngoogle.setOnLoadCallback(rgviz_draw_usersChart);\n</script>\n\n\n</div>\n</div>\n<footer class='footer'>\n<p>Zurban Culture v2.0 - Rails 3.2.13 (staging)/Ruby 1.9.3 patchlevel 327 2012-11-10 - /srv/www/jeansattitude/releases/20130423082652</p>\n</footer>\n</div>\n<script src=\"/assets/admin-ac2e83dde06736c3279cc5c973afd46a.js\" type=\"text/javascript\"></script>\n\n</body>\n</html>\n" 

有人有一個想法,爲什麼請求失敗,身體沒有包含和它需要的數組?在這裏你可以看到我的traceroute,但是我不清楚是什麼導致了這個問題,因爲我沒有在其中看到我的應用程序的任何痕跡,也沒有向我的應用程序傳遞任何此功能。

NoMethodError (undefined method `each' for #<String:0x00000009371f28>): 
    rack (1.4.5) lib/rack/etag.rb:59:in `digest_body' 
    rack (1.4.5) lib/rack/etag.rb:26:in `call' 
    rack (1.4.5) lib/rack/conditionalget.rb:25:in `call' 
    actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call' 
    actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call' 
    actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242: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' 
    actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call' 
    activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call' 
    activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479: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__965187821369700966__call__4271865895200548975__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' 
    actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call' 
    airbrake (3.1.11) lib/airbrake/rails/middleware.rb:13:in `call' 
    actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call' 
    actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56: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' 
    actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call' 
    rack (1.4.5) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.4.5) lib/rack/runtime.rb:17:in `call' 
    activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call' 
    rack (1.4.5) lib/rack/lock.rb:15:in `call' 
    actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63: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' 
    airbrake (3.1.11) lib/airbrake/user_informer.rb:16:in `_call' 
    airbrake (3.1.11) lib/airbrake/user_informer.rb:12: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' 
    passenger (3.0.19) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request' 
    passenger (3.0.19) lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request' 
    passenger (3.0.19) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop' 
    passenger (3.0.19) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler' 
    passenger (3.0.19) lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application' 
    passenger (3.0.19) lib/phusion_passenger/utils.rb:470:in `safe_fork' 
    passenger (3.0.19) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server.rb:180:in `start' 
    passenger (3.0.19) lib/phusion_passenger/rack/application_spawner.rb:129:in `start' 
    passenger (3.0.19) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add' 
    passenger (3.0.19) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize' 
    <internal:prelude>:10:in `synchronize' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' 
    passenger (3.0.19) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application' 
    passenger (3.0.19) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application' 
    passenger (3.0.19) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' 
    passenger (3.0.19) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' 
    passenger (3.0.19) helper-scripts/passenger-spawn-server:99:in `<main>' 

另請參閱我的問題我打開機架寶石,但它似乎不是一個問題。 https://github.com/rack/rack/issues/548

SOLUTION:

發生這種情況,因爲這是恢復身體作爲一個字符串的自定義中間件的,我在一個數組這個包裹身體和問題得到解決!謝謝您的幫助!

+2

它看起來像你的應用程序,或者是一塊您的應用程序和'機架:: Etag'之間的中間件,返回一個字符串作爲響應主體,而不是對「每個」作出響應的東西。你有沒有添加任何中間件? (在Ruby 1.8和更早的版本中,返回一個字符串作爲響應體,但在Ruby 1.9中''''''''''''''''''''''。 – matt 2013-04-23 18:52:19

+0

@matt謝謝!我確實使用了一箇中間件來重寫我的s3資產的路徑,似乎它是爲Ruby 1.8編寫的!非常感謝! – SteenhouwerD 2013-04-23 19:17:37

回答

0

你說:

我檢查身體,它是在它我的網頁的所有HTML代碼的字符串。該參數的數據類型應該是一個數組。

body參數來自哪裏?你期望這個數組的元素是什麼?看起來這可能你想要什麼:

def digest_body(body) 
    parts = body.split("\n") 
    string_body = parts.join 
    digest = Digest::MD5.hexdigest(string_body) unless string_body.empty? 
    [digest, parts] 
end 
+0

這是包括這個的機架寶石,而不是我。我編輯寶石,並將body.inspect放入其中,並看到它是一個字符串。通常它應該是一個有很多東西的數組(標題,...)。就像我在文章中提到的那樣,我不會將其明確地稱爲「明確的」,它被深深地稱爲軌跡,我認爲它無法找到導致此問題的原因。 – SteenhouwerD 2013-04-23 18:33:12

相關問題