# Problem with using YAML for configuration files

**URL:** <https://www.ruby-forum.com/t/problem-with-using-yaml-for-configuration-files/103982>\
**Category:** Ruby\
**Created:** [May 12, 2007, 10:46am UTC](https://www.ruby-forum.com/t/problem-with-using-yaml-for-configuration-files/103982 "2007-05-12T10:46:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eliben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3bc359/32.png) [@eliben](https://www.ruby-forum.com/u/eliben)\
**Post date:** [May 12, 2007, 10:46am UTC](https://www.ruby-forum.com/t/problem-with-using-yaml-for-configuration-files/103982/1 "2007-05-12T10:46:12Z")

</div>

Hello,

I’m using YAML for configuration files in my current Ruby application,  
and the yaml.rb module to load them (YAML::load is about all I use).

One problem I ran into is error reporting, on the semantic level (not  
YAML errors). Say a user makes an error in some configuration item,  
and I want to emit a useful error message that will guide him to the  
problem. This isn’t easy at all with YAML, since after YAML::load all  
I have is a hash table, completely detached from the actual  
configuration file. And I’d really want to let the user know, for  
instance, on which line the error occurred.

This is probably a general YAML problem rather than a Ruby problem,  
but I’d still like to ask here whether anyone ever encountered this ?  
What are the solutions, in your opinion ?

Thanks in advance  
Eli

---

<div class="post-metadata">

**Author:** ![eliben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3bc359/32.png) [@eliben](https://www.ruby-forum.com/u/eliben)\
**Post date:** [May 12, 2007, 10:47am UTC](https://www.ruby-forum.com/t/problem-with-using-yaml-for-configuration-files/103982/2 "2007-05-12T10:47:12Z")

</div>

dear sender,  
i´m out of the office until may 29th.  
your email will not be forwarded.  
for urgent stuff please contact removed\_email\_address@domain.invalid  
kind regards,  
alexander
