Rails 从应用程序收到的响应不完整
Rails Incomplete response received from application
Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic x86_64)
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
Rails 2.3.14
Apache/2.4.7 (Ubuntu)
Phusion Passenger version 5.0.21
App 6748 stderr: Error during failsafe response: "\xD0" from ASCII-8BIT to UTF-8
App 6748 stderr:
[ 2015-11-20 12:58:26.6770 6711/7f2455b2f700 age/Cor/Req/Utils.cpp:96 ]: [Client 1-19] Sending 502 response: application did not send a complete response
App 6748 stderr: [ 2015-11-20 12:58:26.6772 7800/0x000000020fcf88(Worker 1) utils.rb:87 ]: *** Exception NoMethodError (You have a nil object when you didn't expect it!
App 6748 stderr: You might have expected an instance of ActiveRecord::Base.
App 6748 stderr: The error occurred while evaluating nil.[]) (process 7800, thread 0x000000020fcf88(Worker 1)):
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:127:in `process_request'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
[ 2015-11-20 12:58:31.0215 6711/7f245c2fd700 age/Cor/App/Poo/AnalyticsCollection.cpp:105 ]: Process (pid=7800, group=[application_folder] (development)) no longer exists! Detaching it from
the pool.
[ 2015-11-20 12:58:31.0215 6711/7f245c2fd700 age/Cor/CoreMain.cpp:794 ]: Disconnecting long-running connections for process 7800, application [application_folder] (development)
App 7852 stdout:
我尝试将所有控制器源文件转换为 UTF-8 格式并在文件开头添加 #encoding: utf-8
。尝试将密钥添加到 app/secret.yml
,重新启动服务器,但没有任何反应。
Apache 日志显示了一些关于 ActiveRecord::Base
的内容。但我只生成了一些模型,并没有触及 app/models/*
.
中的文件
这是因为我在控制器中使用了 unicode 符号。
当我将 RAILS_ROOT/app/controllers/*
中所有控制器的编码设置为 UTF-8
而不是 UTF-8 without BOM
时,一切正常。
Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic x86_64)
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
Rails 2.3.14
Apache/2.4.7 (Ubuntu)
Phusion Passenger version 5.0.21
App 6748 stderr: Error during failsafe response: "\xD0" from ASCII-8BIT to UTF-8
App 6748 stderr:
[ 2015-11-20 12:58:26.6770 6711/7f2455b2f700 age/Cor/Req/Utils.cpp:96 ]: [Client 1-19] Sending 502 response: application did not send a complete response
App 6748 stderr: [ 2015-11-20 12:58:26.6772 7800/0x000000020fcf88(Worker 1) utils.rb:87 ]: *** Exception NoMethodError (You have a nil object when you didn't expect it!
App 6748 stderr: You might have expected an instance of ActiveRecord::Base.
App 6748 stderr: The error occurred while evaluating nil.[]) (process 7800, thread 0x000000020fcf88(Worker 1)):
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:127:in `process_request'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
App 6748 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
[ 2015-11-20 12:58:31.0215 6711/7f245c2fd700 age/Cor/App/Poo/AnalyticsCollection.cpp:105 ]: Process (pid=7800, group=[application_folder] (development)) no longer exists! Detaching it from
the pool.
[ 2015-11-20 12:58:31.0215 6711/7f245c2fd700 age/Cor/CoreMain.cpp:794 ]: Disconnecting long-running connections for process 7800, application [application_folder] (development)
App 7852 stdout:
我尝试将所有控制器源文件转换为 UTF-8 格式并在文件开头添加 #encoding: utf-8
。尝试将密钥添加到 app/secret.yml
,重新启动服务器,但没有任何反应。
Apache 日志显示了一些关于 ActiveRecord::Base
的内容。但我只生成了一些模型,并没有触及 app/models/*
.
这是因为我在控制器中使用了 unicode 符号。
当我将 RAILS_ROOT/app/controllers/*
中所有控制器的编码设置为 UTF-8
而不是 UTF-8 without BOM
时,一切正常。