Windows 서버에 Rails 애플리케이션을 설치 한 것은 이번이 처음입니다. Helicon Zoo를 사용하여 Windows Server 2008 컴퓨터에서 레일 응용 프로그램을 설치했습니다. 시간이 좀 걸렸지 만 전체 응용 프로그램이 거의 완벽하게 실행되었습니다.레일스 send_file이 400mb보다 큰 파일로 작동하지 않습니다.
내 문제는 400MB 이상의 파일을 다운로드 중입니다.
응용 프로그램/컨트롤러/hosted_files_controller.rb
class HostedFilesController < ApplicationController
before_filter :authenticate_user!
around_filter :catch_not_foun
def download
@footprint = UserAbility.new(current_user).footprints.find(params[:id])
send_file path
end
private
def path
if @footprint.subpath?
@path = "#{HOSTED_FILES_PATH}\\#{@footprint.subpath}\\#{@footprint.filename}"
else
@path = "#{HOSTED_FILES_PATH}\\#{@footprint.filename}"
end
end
def catch_not_found
yield
rescue ActiveRecord::RecordNotFound
recover_and_log "We couldn't find that record.", "No record found using the id (#{params[:id]})"
rescue ActionController::MissingFile
recover_and_log "We couldn't find the file on our server.", "The file was not found at the following path: #{@path}"
end
def recover_and_log (displayed, logged)
logger.info "!!! Error: #{logged}"
redirect_to root_url, alert: displayed
end
end
내가 config.action_dispatch.x_sendfile_header이 주석 한 내 레일 응용 프로그램에서
본인은 클라이언트에게 파일을 전송하려면 다음을 사용하십시오 내가 Apache 나 Nginx를 사용하지 않기 때문에 production.rb 파일에서.
이 기능은 서버에서 ~ 400MB 미만의 모든 파일에 유용합니다. 내가 그 위에 도착 후, 나는 다음과 같은 말한다 헬리 동물원에서 500 내부 서버 오류 :
Helicon Zoo module has caught up an error. Please see the details below.
Worker Status
The process was created
Windows error
The pipe has been ended. (ERROR CODE: 109)
Internal module error
message: ZooApplication backend read Error.
type: ZooException
file: Jobs\JobBase.cpp
line: 566
version: 3.1.98.508
STDERR
Empty stderr
사람이 무슨 일이 일어나고 있는지 어떤 생각을 가지고 있습니까? 나는 잃어 버렸다.
나는 시도했다 :
- 는
- 변화 (작동하지 않았다)
- 응용 프로그램 풀에 대한 IIS에서 메모리 설정에 놀러 (작동하지 않았다) send_file에 BUFFER_SIZE를 증가 X-sendfile을하고 X-가속 - 리디렉션에 x_sendfile_header 내가 윈도우 서버에 아파치를 설치하려고 고려하고 아팍에 파일을 전송 오프로드하기 위해 x_sendfile_header을 사용하고
을 (작동하지 않았다) 그는,하지만 나는 이미 (거의) 작동하는 응용 프로그램을 망쳐 두려워.
누구에게이 문제를 해결할 수있는 아이디어가 있습니까?
레일 위의 루비 문제가 아닙니다. 귀하의 응용 프로그램/웹 서버에 문제가 있습니다. 데이터 보내기 제한이 있으므로 nginx처럼 당신은 클라이언트 최대 몸 크기를 지정할 수 있습니다. –