# Undefined method \`to\_sym' for #\<YAML::Syck::MergeKey

**URL:** <https://www.ruby-forum.com/t/undefined-method-to-sym-for-yaml-mergekey/79923>\
**Category:** Ruby\
**Created:** [December 20, 2006, 6:23pm UTC](https://www.ruby-forum.com/t/undefined-method-to-sym-for-yaml-mergekey/79923 "2006-12-20T18:23:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jolly\_Ole\_King\_Want](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jolly\_Ole\_King\_Want](https://www.ruby-forum.com/u/Jolly_Ole_King_Want)\
**Post date:** [December 20, 2006, 6:23pm UTC](https://www.ruby-forum.com/t/undefined-method-to-sym-for-yaml-mergekey/79923/1 "2006-12-20T18:23:42Z")

</div>

I have a stock gentoo ruby/rails install. I get something like this  
when I  
try to use script/generate, rake migrate or script/console and probably  
others.

0 wicked www/sharkwatch % ./script/console  
Loading development environment.

/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/core\_ext/hash/keys.rb:27:in  
`symbolize_keys':NoMethodError: undefined method`to\_sym’ for  
#YAML::Syck::MergeKey:0xb71dfa6c

to\_sym is indeed _not_ defined in /usr/lib/ruby/1.8/yaml.rb or  
/usr/lib/ruby/1.8/yaml/\*

What’s going on here?

Thanks,  
–Dean

---

<div class="post-metadata">

**Author:** ![Jolly\_Ole\_King\_Want](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jolly\_Ole\_King\_Want](https://www.ruby-forum.com/u/Jolly_Ole_King_Want)\
**Post date:** [December 20, 2006, 7:29pm UTC](https://www.ruby-forum.com/t/undefined-method-to-sym-for-yaml-mergekey/79923/2 "2006-12-20T19:29:07Z")

</div>

What is the output from % ruby -v

I know partly what is happening is making the keys for a hash as  
symbols, hence symbolize\_keys. Now that may have been obvious, but is  
the reason why? Turns out, at least for me it was not obvious that a  
String key and a symbol key of the same name are not equivalent, that is  
they don’t hash equally. So, I believe this is part of the equation,  
wish I knew more. Hope this leads to getting help.
