我在生产环境中的rails app上运行ruby,我的ruby版本是1.8.7,rails版本是3.2.0。 但是当URL变得更大或某个人点击该URL时,我将得到一个错误消息,这里是错误日志的后面跟踪。
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/uri/common.rb:436:in `split'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/uri/common.rb:485:in `parse'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:275:in `open_http'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:162:in `catch'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:518:in `open'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:30:in `open'
app/controllers/home_controller.rb:107:in `import_items'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:32:in `open_uri_original_open'
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/open-uri.rb:32:in `open'
app/controllers/home_controller.rb:106:in `import_items'
actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.0.7) lib/active_support/callbacks.rb:461:in `_run__738958071__process_action__908136048__callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `send'
activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `send'
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rescue.rb:17:in `process_action'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `process_action'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:255:in `perform_action_with_newrelic_trace'
newrelic_rpm (3.3.1) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:250:in `perform_action_with_newrelic_trace'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.7) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal.rb:178:in `action'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:89:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:493:in `call'
newrelic_rpm (3.3.1) lib/new_relic/rack/browser_monitoring.rb:23:in `call'
/home/ubuntu/.rvm/gems/ruby-1.8.7-p334/bundler/gems/exception_notification-7b77a4ea1a61/lib/exception_notifier.rb:31:in `call'
spree_core (0.50.2) lib/middleware/seo_assist.rb:23:in `call'
spree_core (0.50.2) lib/redirect_legacy_product_url.rb:10:in `call'
warden (1.0.6) lib/warden/manager.rb:35:in `call'
warden (1.0.6) lib/warden/manager.rb:34:in `catch'
warden (1.0.6) lib/warden/manager.rb:34:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.2) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.7) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.7) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.2) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.7) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.2) lib/rack/runtime.rb:17:in `call'
rack (1.2.2) lib/rack/lock.rb:11:in `call'
rack (1.2.2) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.2) lib/rack/lock.rb:11:in `call'
railties (3.0.7) lib/rails/application.rb:168:in `call'
railties (3.0.7) lib/rails/application.rb:77:in `send'
railties (3.0.7) lib/rails/application.rb:77:in `method_missing'
passenger (3.0.7) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.7) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.7) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:170:in `send'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:170:in `handle_spawn_application'
passenger (3.0.7) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.7) helper-scripts/passenger-spawn-server:99
答案 0 :(得分:1)
检查Rails指南中的以下句子。
“请注意,Ruby 1.8.7 p248和p249具有导致Rails崩溃的编组错误。自1.8.7-2010.02发布以来,Ruby Enterprise Edition已经修复了这些错误。在1.9版本中,Ruby 1.9.1不是可用,因为它完全是段错误,所以如果你想使用1.9.x,请跳到1.9.2或1.9.3以便顺利航行。“
最好升级ruby版本(1.9.2)。