<< CharacterEncodings | Index | Gd2 >>
The Ruby dbi gem's Hash-Iteration breaks with Ruby 1.9.2. 1.9.1 did work. This is the fix of Chuck Remes. Thank you Chuck:
/usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/columninfo.rb
change these lines
- h.each_key do |k| + h.keys.each do |k|
also see
http://groups.google.com/group/rubyinstaller/msg/e44ece960889f30e
So in
/usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/statement.rb
we changed
#fetched_rows.push(row)
to
fetched_rows.push(row.to_a)
and it works! But we do not yet understand why it works for Ruby 1.9.2
Why did I add 'to_a' method? (thought flow)
* When I looked at the 'row' by 'p' method, it looked like an Array * I checked 'row' class by writing 'p row.class' then it showed 'DBI::Row' * I checked DBI::Row definition (/usr/lib64/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/row.rb) * There is 'to_a' method defined * Also see: http://erik.hollensbe.org/docs/ruby-dbi/DBI/Row.html#method-i-to_a
further