Bucco
5/29/2006 3:03:00 AM
I am testing a program:
require 'yaml'
array = [1, 2, 3, [4, "five", :six]]
puts "Original array:"
puts array.inspect
yarray = array.to_yaml
puts "YAML representation of array: "
puts yarray
thawed = YAML.load(yarray)
puts "Array re-loaded from YAML string: "
p thawed
When I run this in radrails I get the following errors:
Original array:
[1, 2, 3, [4, "five", :six]]
C:\Documents and Settings\sarmstrong\My
Documents\sandbox\yaml/yaml.rb:5: undefined method `to_yaml' for [1, 2,
3, [4, "five", :six]]:Array (NoMethodError)
from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
from C:/Documents and Settings/sarmstrong/My
Documents/sandbox/yaml/yaml.rb:1
When I run the program in the cmd with ruby testfile.rb, the program
works like it is suposed to. I am running radrails on Windows XP.
Anyone know what may be causing the issue?
Thanks:)
SA