Input/output error

Hi

My application was running fine. All of sudden I started to get an
input/output error in one of the templates. However, error goes away
once I restart the mongrel server but after some time again same error
appears. I am pasting the trace below. Please help me getting rid of
this error forever.

ActionView::TemplateError (Input/output error) on line #46 of
app/views/starwars/edit_folders.rhtml:
43:


44: Platform Applicable:   
45:
46: <%= select ‘plat’,‘id’,Platform.find(:all,:order => ‘start
DESC’).collect{|p| [p.name, p.id]},{:selected =>
Platform.find(params[:p]).id} %>
47:
48:
49: <%#= link_to_function “ADD”,“Folders.copy_select();” %>
/usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:349:in

write' /usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:349:inid’
/usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:349:in
send' /usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:349:invalue’
/usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:340:in
value' /usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_options_helper.rb:300:into_select_tag’
/usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_options_helper.rb:66:in
select' #{RAILS_ROOT}/app/views/starwars/edit_folders.rhtml:46:in_run_rhtml_47app47views47starwars47edit_folders46rhtml’
/usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/capture_helper.rb:108:in
call' /usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/capture_helper.rb:108:incapture_erb_with_buffer’

Thanks in advance,
Nitin.

Hi guys please help me out of this error.

Nitin.

On Thu, May 6, 2010 at 4:44 AM, Nitin M. [email protected]
wrote:

43:
write' /usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/form_options_helper.rb:66:in select’
#{RAILS_ROOT}/app/views/starwars/edit_folders.rhtml:46:in
_run_rhtml_47app47views47starwars47edit_folders46rhtml' /usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/capture_helper.rb:108:in call’
/usr/local/rubygems/gems/gems/actionpack-1.13.3/lib/action_view/helpers/capture_helper.rb:108:in
`capture_erb_with_buffer’

That’s an OLD version of Rails!

Not sure what’s going on but it appears that id is being sent to
whatever the @plat instance variable is referring to, and that is
somehow doing a write.

What does the controller code look like


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: rubyredrick (Rick DeNatale) · GitHub
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Hi Rick,

Thanks for reply. Could use of the old version cause this problem?
Actually I wanted to use the latest version of Rails but that was not
compatible with the ruby installed in my system and I could not figure
out which Ruby version was compatible with latest Rails at that time
(2.3.4).

I my code the instance variable @plat refers to platforms, similarly the
variable @rel refers to release. So actually I have folders in my
application that is applicable for some releases and platforms. After
selecting these platforms and releases a Javascript is called which
stores the combination of release and platforms and stored in another
dropdown menu with name platrel with platform name nd release name
separated by a hyphen ("-") so in controller you will only see the
variable platrel. I am pasting the controller code below.

Contrller code:

params[:platrel][‘id’].each {|x|
pr = “”
pr = x.split("-")
platid = Platform.find(:first,:conditions => [‘name =
?’,pr[0].to_s]).id
relid = Release.find(:first,:conditions => [‘release_name =
?’,pr[1].to_s]).id
@newAvail = Ownership.find(:first, :conditions => [‘folder_id =
? and platform_id = ? and release_id = ? and stop IS NULL and deleted
IS NULL’, params[:f],platid,relid])
if @newAvail.blank?
@ownerships = Ownership.new(
:folder_id => params[:f],
:platform_id => platid,
:release_id => relid,
:primary_owner => @fold_owner.primary_owner,
:secondary_owner => @fold_owner.secondary_owner,
:created => Time.new,
:start => Time.new )
@ownerships.save
if (pr[0].to_s != “Any”)
anyid = Platform.find(:first,:conditions =>
[‘name = “Any”’]).id
@anyAvail = Ownership.find(:first, :conditions
=> [‘folder_id = ? and platform_id = ? and release_id = ? and stop IS
NULL and deleted IS NULL’, params[:f],anyid,relid])
if @anyAvail.blank?
@any_ownerships = Ownership.new(
:folder_id => params[:f],
:platform_id => anyid,
:release_id => relid,
:primary_owner =>
@fold_owner.primary_owner,
:secondary_owner =>
@fold_owner.secondary_owner,
:created => Time.new,
:start => Time.new )
@any_ownerships.save
end
end

    else
    @newAvail.stop = 'NULL'
    @newAvail.deleted = 'NULL'

Thanks,
Nitin.

Based on the walkback, whatever object the @plat instance variable is
assigned to is causing the error when sent the id message, hopefully
your own debugging skills will enable you to use that clue to figure
it out.

The code seems to be way too complicated for me to help you much more
remotely.

On Fri, May 7, 2010 at 2:48 AM, Nitin M. [email protected]
wrote:

application that is applicable for some releases and platforms. After
pr = x.split(“-”)
:platform_id => platid,
=> ['folder_id = ? and platform_id = ? and release_id = ? and stop IS
:created => Time.new,

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: rubyredrick (Rick DeNatale) · GitHub
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Thnaks Rick…Can you please tell me what are all possible causes of
input/output errors?

Nitin.

Rick, Can you also please tell me possible causes of Input/Output
errors. Sometimes I found that if I leave a space between a function
name and the brackets for arguments (e.g. find (:all)). It gives this
error. and sometimes if I use stdout, stderr functions in controller or
view files it gives this error.

Thanks,
Nitin.