# Saving to YAML not working as expected

**URL:** <https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015>\
**Category:** IronRuby\
**Created:** [March 30, 2010, 1:22pm UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015 "2010-03-30T13:22:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 30, 2010, 1:22pm UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/1 "2010-03-30T13:22:48Z")

</div>

I am following the Stock Portfolio post from [RubyQuiz.com](http://RubyQuiz.com) and it  
involves using YAML for its storage. Under ruby 1.8.7, the data is  
being saved and loaded with no problem. Under ironruby rc4, when it  
gets saved and then retrieved it changes the data to its object type.  
For example on the first same it saves the data correctly.

name: !str:CSV::Cell Google Inc.

After a reload of the data it changes the previous line to.

name: !ruby/object:IronRuby::StandardLibrary::Yaml::PrivateType {}

This then throws off what data it is trying to use and display. Is  
there something i need to do so that ironruby doesn’t change the data  
into its type? This does work correctly under a ruby implementation,  
no special gems or anything, just plain ole ruby. I can load and save  
the data all day and it works just fine. I prefer ironruby however and  
would love to get this working under it.

Link: [Ruby Quiz - Stock Portfolios (#41)](http://www.rubyquiz.com/quiz41.html)

Thanks,  
-Nick

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 30, 2010, 6:22pm UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/2 "2010-03-30T18:22:22Z")

</div>

This looks like a bug. Could you sent us a simple self-contained repro?  
It would help us to identity the issue faster.

Thanks,  
Tomas

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 30, 2010, 8:13pm UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/3 "2010-03-30T20:13:35Z")

</div>

My ruby isn’t the best so i included the source i am working with.

1. start the script (no args)
2. type “buy 10 msft”
3. type “history” (view output)
4. type “exit”
5. view yaml file (should look good here)
6. start the script again (no args)
7. type “history” (different than before)
8. you’ll see the first part of the object type
9. type “exit”
10. view the yaml file

Hope this helps.  
-Nick

On Tue, Mar 30, 2010 at 12:07 PM, Tomas M.

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 30, 2010, 10:09pm UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/4 "2010-03-30T22:09:24Z")

</div>

Thanks! I’ve filed a bug  
[http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284](http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284).

Tomas

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 31, 2010, 6:16am UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/5 "2010-03-31T06:16:14Z")

</div>

## Not sure if this is related, but I just tried building on Mono 2.6.3 on the Mac and am getting a build error here:

## yaml

BuiltinsOps.cs(135,17): warning CS0168: The variable `encoding' is declared but never used Engine/BaseConstructor.cs(661,41): error CS1501: No overload for method `ToUpperInvariant’ takes `0’ arguments  
Compilation failed: 1 error(s), 1 warnings  
rake aborted!  
Command failed with status (1): [gmcs /noconfig  
@/var/folders/LV/LVQdctQPGL…]

Could there be something related?

Ryan R.

Email: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 31, 2010, 4:36am UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/6 "2010-03-31T04:36:15Z")

</div>

Tomas M. wrote:

> Thanks! I’ve filed a bug  
> [http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284](http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284).
> 
> Tomas

Hello Tomas! I’m having the exact same problem as Nick. Unfortunately,  
this error is a show stopper for me. I’m writing an application that  
needs to read a ton of YAML, and I can’t do any testing until this bug  
is fixed. I’d love to stub out part of the code to continue testing, but  
that’s not a possibility in my particular case (my app needs to load  
~100 Ruby scripts that I do not have any control over).

Is there any chance that the priority on this could be bumped up (please  
:p)? I’d do my testing off the trunk if this gets patched before RC5.

(BTW, I left a comment on the CodePlex site.)

Thanks,  
-Charles

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 31, 2010, 8:00am UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/7 "2010-03-31T08:00:22Z")

</div>

Nope, this looks more like a bug in Mono (or the rake build).

Tomas

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Tuesday, March 30, 2010 9:07 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Saving to YAML not working as expected.

## Not sure if this is related, but I just tried building on Mono 2.6.3 on the Mac and am getting a build error here:

## yaml

BuiltinsOps.cs(135,17): warning CS0168: The variable `encoding' is declared but never used Engine/BaseConstructor.cs(661,41): error CS1501: No overload for method `ToUpperInvariant’ takes `0’ arguments  
Compilation failed: 1 error(s), 1 warnings  
rake aborted!  
Command failed with status (1): [gmcs /noconfig  
@/var/folders/LV/LVQdctQPGL…]

Could there be something related?

Ryan R.

Email: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)

On Tue, Mar 30, 2010 at 7:36 PM, Charles S.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Tomas M. wrote:

> Thanks! I’ve filed a bug  
> [http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284](http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284).
> 
> Tomas  
> Hello Tomas! I’m having the exact same problem as Nick. Unfortunately,  
> this error is a show stopper for me. I’m writing an application that  
> needs to read a ton of YAML, and I can’t do any testing until this bug  
> is fixed. I’d love to stub out part of the code to continue testing, but  
> that’s not a possibility in my particular case (my app needs to load  
> ~100 Ruby scripts that I do not have any control over).

Is there any chance that the priority on this could be bumped up (please  
:p)? I’d do my testing off the trunk if this gets patched before RC5.

(BTW, I left a comment on the CodePlex site.)

## Thanks, -Charles

Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 31, 2010, 7:13pm UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/8 "2010-03-31T19:13:39Z")

</div>

Does Xbuild work then (in place of rake)? Or do we still have issues  
with casing and such?

JD

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Tomas M.  
Sent: Tuesday, March 30, 2010 11:00 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Saving to YAML not working as expected.

Nope, this looks more like a bug in Mono (or the rake build).

Tomas

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Tuesday, March 30, 2010 9:07 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Saving to YAML not working as expected.

## Not sure if this is related, but I just tried building on Mono 2.6.3 on the Mac and am getting a build error here:

## yaml

BuiltinsOps.cs(135,17): warning CS0168: The variable `encoding' is declared but never used Engine/BaseConstructor.cs(661,41): error CS1501: No overload for method `ToUpperInvariant’ takes `0’ arguments  
Compilation failed: 1 error(s), 1 warnings  
rake aborted!  
Command failed with status (1): [gmcs /noconfig  
@/var/folders/LV/LVQdctQPGL…]

Could there be something related?

Ryan R.

Email: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)  
On Tue, Mar 30, 2010 at 7:36 PM, Charles S.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Tomas M. wrote:

> Thanks! I’ve filed a bug  
> [http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284](http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284).
> 
> Tomas  
> Hello Tomas! I’m having the exact same problem as Nick. Unfortunately,  
> this error is a show stopper for me. I’m writing an application that  
> needs to read a ton of YAML, and I can’t do any testing until this bug  
> is fixed. I’d love to stub out part of the code to continue testing, but  
> that’s not a possibility in my particular case (my app needs to load  
> ~100 Ruby scripts that I do not have any control over).

Is there any chance that the priority on this could be bumped up (please  
:p)? I’d do my testing off the trunk if this gets patched before RC5.

(BTW, I left a comment on the CodePlex site.)

## Thanks, -Charles

Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [March 31, 2010, 7:31pm UTC](https://www.ruby-forum.com/t/saving-to-yaml-not-working-as-expected/186015/9 "2010-03-31T19:31:49Z")

</div>

Unfortunately Mono C# compiler in 2.6.3 is broken again. I havenâ€™t had  
time to investigate yet, but Iâ€™ll look at that in a week or two.

In any case xbuild is the way how to build IronRuby and IronPython on  
Mono. We are not going to maintain rake files that duplicate msbuild  
project system.

Tomas

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Jim D.  
Sent: Wednesday, March 31, 2010 10:04 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Saving to YAML not working as expected.

Does Xbuild work then (in place of rake)? Or do we still have issues  
with casing and such?

JD

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Tomas M.  
Sent: Tuesday, March 30, 2010 11:00 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Saving to YAML not working as expected.

Nope, this looks more like a bug in Mono (or the rake build).

Tomas

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ryan R.  
Sent: Tuesday, March 30, 2010 9:07 PM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Saving to YAML not working as expected.

## Not sure if this is related, but I just tried building on Mono 2.6.3 on the Mac and am getting a build error here:

## yaml

BuiltinsOps.cs(135,17): warning CS0168: The variable `encoding' is declared but never used Engine/BaseConstructor.cs(661,41): error CS1501: No overload for method `ToUpperInvariant’ takes `0’ arguments  
Compilation failed: 1 error(s), 1 warnings  
rake aborted!  
Command failed with status (1): [gmcs /noconfig  
@/var/folders/LV/LVQdctQPGL…]

Could there be something related?

Ryan R.

Email: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
LinkedIn: [http://www.linkedin.com/in/ryanriley](http://www.linkedin.com/in/ryanriley)  
Blog: [http://wizardsofsmart.net/](http://wizardsofsmart.net/)  
Twitter: @panesofglass  
Website: [http://panesofglass.org/](http://panesofglass.org/)  
On Tue, Mar 30, 2010 at 7:36 PM, Charles S.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Tomas M. wrote:

> Thanks! I’ve filed a bug  
> [http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284](http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4284).
> 
> Tomas  
> Hello Tomas! I’m having the exact same problem as Nick. Unfortunately,  
> this error is a show stopper for me. I’m writing an application that  
> needs to read a ton of YAML, and I can’t do any testing until this bug  
> is fixed. I’d love to stub out part of the code to continue testing, but  
> that’s not a possibility in my particular case (my app needs to load  
> ~100 Ruby scripts that I do not have any control over).

Is there any chance that the priority on this could be bumped up (please  
:p)? I’d do my testing off the trunk if this gets patched before RC5.

(BTW, I left a comment on the CodePlex site.)

## Thanks, -Charles

Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
