gpt4 book ai didi

ruby-on-rails - Ruby 1.9.1-p234、Passenger 2.2.5、Rails 2.3-stable 在 POST 请求时关闭流

转载 作者:数据小太阳 更新时间:2023-10-29 06:54:14 24 4
gpt4 key购买 nike

我已经在 Ubuntu 服务器上安装了 Ruby 1.9.1 (p234)。我正在尝试在 Apache 2.2/Passenger 2.2.5 上部署一个供应商 Rails 2.3-stable 的 Rails 应用程序。

GET 请求工作正常,POST 请求立即中断并显示以下日志条目:

Processing UsersController#new (for 80.203.77.44 at 2009-10-24 20:54:55) [GET]
Parameters: {"controller"=>"users", "action"=>"new"}
Rendering template within layouts/application
Rendering users/new
Completed in 23ms (View: 20, DB: 0) | 200 OK [<a href="http://myapp/user/new]" rel="noreferrer noopener nofollow">http://myapp/user/new]</a>
/!\ FAILSAFE /!\ 2009-10-24 20:55:01 +0200
Status: 500 Internal Server Error
closed stream
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/rewindable_input.rb:86:in <code>make_rewindable'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/rewindable_input.rb:26:in</code>read'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/request.rb:136:in <code>POST'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/methodoverride.rb:15:in</code>call'
/var/www/myapp/app/releases/20091021213913/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in <code>call'
/var/www/myapp/app/releases/20091021213913/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in</code>call'
/var/www/myapp/app/releases/20091021213913/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in <code>call'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/lock.rb:11:in</code>block in call'
:8:in <code>synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/lock.rb:11:in</code>call'
/var/www/myapp/app/releases/20091021213913/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in <code>call'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/rack/request_handler.rb:95:in</code>process_request'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/abstract_request_handler.rb:207:in <code>main_loop'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/railz/application_spawner.rb:378:in</code>start_request_handler'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/railz/application_spawner.rb:336:in <code>block in handle_spawn_application'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb:183:in</code>safe_fork'
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/railz/application_spawner.rb:334:in `handle_spawn_application'

...然后是一些。

我已经阅读并找到了这个:http://blog.labnotes.org/2009/09/01/ruby-1-9-1-p234passenger-2-2-5-tempfile-rb-fix/它指向一个补丁,该补丁从 Ruby 1.9.1-p234 的 tempfile.rb 中删除了一行。对我来说不幸的是,检查该文件后我发现攻击性行已被删除。所以这让我有点无能为力,因为我的问题仍然存在。有什么想法吗?

最佳答案

passenger 2.2.8 中有一个解决方法,因此不再需要。

休闲吉姆的上述回应对我有用。非常感谢吉姆的帮助。

我的系统上的差异分别如下。我希望这对您有所帮助。

基里安。

*** /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb.orig Tue Nov  3 17:43:30 2009
--- /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb Tue Nov 3 17:43:46 2009
***************
*** 31,36 ****
--- 31,37 ----
require 'etc'
require 'fcntl'
require 'tempfile'
+ require 'stringio'
require 'phusion_passenger/exceptions'
if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby"
require 'phusion_passenger/native_support'


*** /usr/local/lib/ruby/1.9.1/tempfile.rb.orig Tue Nov 3 17:44:34 2009
--- /usr/local/lib/ruby/1.9.1/tempfile.rb Tue Nov 3 17:45:55 2009
***************
*** 137,143 ****
# keep this order for thread safeness
begin
if File.exist?(@tmpname)
! closed? or close
File.unlink(@tmpname)
end
@@cleanlist.delete(@tmpname)
--- 137,143 ----
# keep this order for thread safeness
begin
if File.exist?(@tmpname)
! # closed? or close
File.unlink(@tmpname)
end
@@cleanlist.delete(@tmpname)

关于ruby-on-rails - Ruby 1.9.1-p234、Passenger 2.2.5、Rails 2.3-stable 在 POST 请求时关闭流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1627582/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com