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: <tr>
44: <td>Platform Applicable: &nbsp;&nbsp;</td>
45: <td>
46: <%= select 'plat','id',Platform.find(:all,:order => 'start
DESC').collect{|p| [p.name, p.id]},{:selected =>
Platform.find(params[:p]).id} %>
47: </td>
48: <td rowspan=2>
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:in
`id'
    /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:in
`value'
    /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:in
`to_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:in
`capture_erb_with_buffer'

Thanks in advance,
Nitin.

Hi guys please help me out of this error.

Nitin.

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

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.

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.

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.

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

Nitin.