[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

undefined method `to_sym' for #

Dean

12/20/2006 5:30:00 AM

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

2 Answers

John Pywtorak

12/20/2006 7:19:00 AM

0

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.

Jolly Ole King Wantshissluts wrote:
> 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
>
>
>



Dean

12/20/2006 7:40:00 AM

0


John Pywtorak wrote:
> What is the output from % ruby -v

0 wicked scripts/sharkwatch % ruby -v
ruby 1.8.5 (2006-12-04 patchlevel 2) [i686-linux]

> 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.

Thanks for the reply,

--Dean