Ruby on Rails 응용 프로그램이 있습니다. Ruby 1.9와 Rails 2.3.4를 사용하고 있으며 사용자가 비디오를 업로드하여 Paperclip 보석이지만 랙에서이 오류가 발생합니다. "유효하지 않은 바이트 시퀀스"라고하는 사실 때문에 루비 1.9에서 나온 것으로 의심됩니다.Ruby 1.9에서 파일 (종이 클립 사용)을 업로드하려고 할 때 Rack이 실패합니다.
어떤 아이디어가 있습니까?
감사합니다,
탐
Rendering posts/new
Rendered posts/_form (4.5ms)
Rendered layouts/_footer (13.5ms)
Completed in 238ms (View: 161, DB: 8) | 200 OK [http://localhost/posts/new]
/!\ FAILSAFE /!\ 2009-09-25 17:26:06 -0700
Status: 500 Internal Server Error
invalid byte sequence in US-ASCII
/Users/tammam56/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/utils.rb:324:in `=~'
/Users/tammam56/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/utils.rb:324:in `block in parse_multipart'
/Users/tammam56/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/utils.rb:319:in `loop'
/Users/tammam56/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/utils.rb:319:in `parse_multipart'
/Users/tammam56/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/request.rb:141:in `POST'
형태 :
<% form_for @post, :html => {:multipart => true} do |f| %>
<table width='100%' border="1">
<tr>
<td colspan="2">
<h2>Post your Story</h2>
</td>
</tr>
<tr>
<td nowrap="nowrap" width="20%">
<p class="new_post_labels">I'm single bacause </p>
<div id='ErrorMessage_title'></div>
</td>
<td>
<%= f.text_field :title, :class => "grayInput fromInputPost", :maxLength =>100, :size => "50" %>
</td>
</tr>
<tr>
<td nowrap="nowrap" width="20%" valign="top">
<p class="new_post_labels">Story Details (maximum 500 characters) </p>
<div class="char_counter_new" id='actual_msg_count'>0/500</div>
<div id='ErrorMessage_description'></div>
</td>
<td>
<%= f.text_area :description, :id => 'the_message_textarea', :size => "45x5", :class => "grayInput fromInputPostArea", :onkeyup => "calculate_msg_char_counter();", :id => "the_message_textarea" %>
</td>
</tr>
<tr>
<td nowrap="nowrap" width="20%">
<p class="new_post_labels">Video URL(optional - 90 seconds max)</p>
</td>
<td>
<%= f.file_field :video %>
<%= f.text_field :video_link, :class => "grayInput fromInputPost", :maxLength =>255, :size => "50" %>
</td>
</tr>
<tr>
<td>
</td>
<td align="left" nowrap="nowrap">
<p class="new_post_labels"><%= f.check_box :is_notify_when_comment %>Email me when someone comments on my story</p>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="button" value="Submit the Story" class="btnSubmitNewUser" onClick="validate_fields(this.form);" />
</td>
</tr>
</tabl
전자> 여기에 답이처럼
양식에 enctype 속성이 있습니까? – Eimantas
양식을 게시 할 수 있습니까? 폼 입력이없는 랙 및 멀티 파트 양식의 문제를 해결했습니다. 그런 것일 수도 있습니다 ... –
@Eimantar : 나는 enctype이 무엇인지 잘 모르겠습니다. 설명해 주시겠습니까? @Doug R : 게시물을 편집하고 양식 코드를 입력 했으므로 양식에 입력 사항이 있습니다. 내가 잘못 생각한 것 같습니까? 감사합니다 – Tam