Symbol as array index error

I don’t know why this code got Symbol as array index error.
Please help me out.
nick314

cl/xmlserial is the library of REXML

require ‘yaml’
require ‘cl/xmlserial’

class Person
include XmlSerialization
attr_accessor :account, :name, :penalty, :problems, :hash
def initialize(account, name, penalty=0, problems=0, hash={})
@account = account
@name = name
@penalty = penalty.to_i
@problems = problems.to_i
@hash = hash
end

def add_problem begin_time, problem, result, submit_time
if @hash.has_key?(problem) and @hash[problem] <= 0
return
end
# …
if result == 2
@penalty += submit_time - begin_time
@problems += 1
if @hash.has_key?(problem)
@penalty += @hash[problem] * 20*60
else
@hash[problem] = 0
end
@hash[problem] *= -1
else
if @hash.has_key?(problem)
@hash[problem] += 1
else
@hash[problem] = 1
end
end
end

def inspect
“#@account, #@problems, #@penalty
end
end

sort criteria => high problems, low penalty, lexicographical account

class Person
include XmlSerialization
def <=>(other)
if @problems == other.problems
if @penalty == other.penalty
return @account <=> other.account
else
return @penalty <=> other.penalty
end
else
return other.problems <=> @problems
end
end
end

class ContestBoard
include XmlSerialization
attr_accessor :people, :begin_time, :problems
def initialize begin_time, problems=nil
@people = []
@begin_time = begin_time
@problems = problems
end

def add account, problem, result, submit_time
if find(account).nil?
person = Person.new(account, User.find (account).name)
person.add_problem(begin_time, problem, result, submit_time)
@people << person
else
index = find(account)
people[index].add_problem(begin_time, problem, result,
submit_time)
end
end

def find account
index = 0
@people.each { |p|
if p.account == account
return index
end
index += 1
}
return nil
end

def show
for person in @people
puts person.inspect
end
end

def sort
@people = @people.sort
end
end

class Serialization
include XmlSerialization
attr_accessor :classType, :type
def initialize classType=ContestBoard, type=“yaml”
@classType = classType
@type = type
end

def serialize obj
if @type == “yaml”
return YAML_serialize obj
elsif @type == “xml”
return XML_serialize(obj)
end
end

def unserialize
if @type == “yaml”
return YAML_unserialize obj
elsif @type == “yaml”
return XML_unserialize obj
end
end

private
def YAML_serialize obj
return YAML.dump(obj)
end

def YAML_unserialize sObj
return YAML.load(sObj)
end

def XML_serialize obj
return obj.to_xml
end

def XML_unserialize sObj
doc = REXML::Document.new(sObj);
return @classType.from_xml(doc.root )
end
end

class ContestsController < ApplicationController
def index
list
render :action => ‘list’
end

GETs should be safe (see

URIs, Addressability, and the use of HTTP GET and POST)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }

contest_board method

def contest_board
@now_contest = Contest.find( get_now_contest );
if !@now_contest.nil?
solveinfos = @now_contest.solveinfos.find(:all, :order =>
“created_at ASC”);
#solveinfos = @now_contest.solveinfos.find(:all, :conditions =>
“solveStatus = 2”, :order => “created_at ASC”);
# get many solveinfo
@board = ContestBoard.new(@now_contest.from)
for solveinfo in solveinfos
@board.add(solveinfo.userID, solveinfo.problemID,
solveinfo.solveStatus, solveinfo.created_at );
end
@board.sort
@users = User.find(:all)

  #@past_contest = PastContests.new
  #@serialization = Serialization.new(@board)
  #@past_contest.contest_id = @now_contest.id
  #@past_contest.format = 'yaml'
  #@past_contest.serialization =  @serialization.serialize
  #@past_contest.save

  puts @board.to_xml
  #@past_contest = PastContests.new
  #@serialization = Serialization.new(ContestBoard, 'xml')
  #@past_contest.contest_id = @now_contest.id
  #@past_contest.format = 'xml'
  #@past_contest.serialization =  @serialization.serialize @board
  #@past_contest.save

end

end

def contest_board_test
@board = ContestBoard.new
@board.add(‘nick314’, 1, 1, 10)
@board.add(‘nick314’, 1, 2, 10)
@board.add(‘nick314’, 2, 1, 10)
@board.add(‘nick314’, 2, 1, 10)
@board.add(‘nick314’, 2, 2, 10)
@board.sort
end

get_now_contest method

def get_now_contest
# there won’t be two contests overlayped
now = Time.now
for contest in Contest.find(:all)
if now >= contest.from and now < contest.to
return contest.id
end
end
return nil
end

list method

def list
@contest1 = Contest.find(1)
@solveinfo = @contest1.solveinfos
@solved_problem = @ solveinfo.find(:all)
# this is wrong
#@contest1.solveinfos << Solveinfo.find( 221 )
@contests_pages, @contests = paginate :contests, :per_page => 10
end

show method

def show
@contests = Contest.find(params[:id])
end

new method

def new
@contests = Contest.new
end

create method

def create
@contests = Contest.new(params[:contests])
if @contests.save
flash[:notice] = ‘Contests was successfully created.’
redirect_to :action => ‘list’
else
render :action => ‘new’
end
end

edit method

def edit
@contests = Contest.find(params[:id])
end

update method

def update
@contests = Contest.find(params[:id])
if @contests.update_attributes(params[:contests])
flash[:notice] = ‘Contest was successfully updated.’
redirect_to :action => ‘show’, :id => @contests
else
render :action => ‘edit’
end
end

destroy method

def destroy
Contest.find(params[:id]).destroy
redirect_to :action => ‘list’
end
end

On 8/19/07, nick314 [email protected] wrote:

I don’t know why this code got Symbol as array index error.
Please help me out.
nick314
It would be helpfull to tell us where in the code the error occurred.
Cheers
Robert

This is the error message.
I Copy these code out of App/Controller…
Then it works fine…
Please help me out.
And tell me why.
Thanks a lot.

nick314

TypeError in ContestsController#contest_board
/usr/lib/ruby/1.8/rexml/parent.rb:58:in `[]': Symbol as array
indexRAILS_ROOT: script/…/config/…

Application Trace | Framework Trace | Full Trace
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:189:in
instance_data_to_xml' /usr/lib/ruby/1.8/rexml/parent.rb:58:in []’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:50:in
to_xml' (eval):1:in instance_data_to_xml’
app/controllers/contests_controller.rb:175:in
contest_board'/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:189:in instance_data_to_xml’
/usr/lib/ruby/1.8/rexml/parent.rb:58:in []' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:50:in to_xml’
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in each' /usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in instance_data_to_xml’
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:66:in to_xml' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in
perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:634:in
call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in process_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in process’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in new’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in initialize’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in load’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:60 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' script/server:3/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:189:in instance_data_to_xml’
/usr/lib/ruby/1.8/rexml/parent.rb:58:in []' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:50:in to_xml’
(eval):1:in instance_data_to_xml' /usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in each’
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in
instance_data_to_xml' /usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:66:in to_xml’
app/controllers/contests_controller.rb:175:in contest_board' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in
perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:634:in
call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in process_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in process’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in new’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in initialize’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in load’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:60 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require’
script/server:3Request
Parameters: None

Show session dump


:return_url: /contests/contest_board
flash: !map:ActionController::Flash::FlashHash {}

Response
Headers: {“cookie”=>[], “Content-Type”=>“text/html; charset=utf-8”,
“Cache-Control”=>“no-cache”}

----- Original Message -----
From: “Robert D.” [email protected]
To: “ruby-talk ML” [email protected]
Sent: Sunday, August 19, 2007 5:46 PM
Subject: Re: Symbol as array index error

This is the error message.
I Copy these code out of App/Controller…
Then it works fine…
Please help me out.
And tell me why.
Thanks a lot.

nick314

TypeError in ContestsController#contest_board
/usr/lib/ruby/1.8/rexml/parent.rb:58:in `[]': Symbol as array
indexRAILS_ROOT: script/…/config/…

Application Trace | Framework Trace | Full Trace
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:189:in
instance_data_to_xml' /usr/lib/ruby/1.8/rexml/parent.rb:58:in []’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:50:in
to_xml' (eval):1:in instance_data_to_xml’
app/controllers/contests_controller.rb:175:in
contest_board'/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:189:in instance_data_to_xml’
/usr/lib/ruby/1.8/rexml/parent.rb:58:in []' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:50:in to_xml’
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in each' /usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in instance_data_to_xml’
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:66:in to_xml' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in
perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:634:in
call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in process_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in process’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in new’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in initialize’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in load’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:60 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' script/server:3/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:189:in instance_data_to_xml’
/usr/lib/ruby/1.8/rexml/parent.rb:58:in []' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:50:in to_xml’
(eval):1:in instance_data_to_xml' /usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in each’
/usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:183:in
instance_data_to_xml' /usr/local/lib/site_ruby/1.8/cl/xmlserial/xmlserial.rb:66:in to_xml’
app/controllers/contests_controller.rb:175:in contest_board' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in
perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:634:in
call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in call_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in perform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in send’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in process_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in process’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in process’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in new’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in initialize’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in each’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in run’
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in load’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in
load' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:60 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in require’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require’
script/server:3Request
Parameters: None

Show session dump


:return_url: /contests/contest_board
flash: !map:ActionController::Flash::FlashHash {}

Response
Headers: {“cookie”=>[], “Content-Type”=>“text/html; charset=utf-8”,
“Cache-Control”=>“no-cache”}

----- Original Message -----
From: “Robert D.” [email protected]
To: “ruby-talk ML” [email protected]
Sent: Sunday, August 19, 2007 5:46 PM
Subject: Re: Symbol as array index error