# Script/generate model Cookbook yields: \`const\_missing': uninitialized constant

**URL:** <https://www.ruby-forum.com/t/script-generate-model-cookbook-yields-const-missing-uninitialized-constant/115889>\
**Category:** Ruby\
**Created:** [September 29, 2007, 10:50pm UTC](https://www.ruby-forum.com/t/script-generate-model-cookbook-yields-const-missing-uninitialized-constant/115889 "2007-09-29T22:50:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [September 29, 2007, 10:50pm UTC](https://www.ruby-forum.com/t/script-generate-model-cookbook-yields-const-missing-uninitialized-constant/115889/1 "2007-09-29T22:50:39Z")

</div>

This only appears to have started in the past day or so. I initially  
noticed a problem yesterday after a gem update(–system, I think)  
started giving me errors when I’d attempt to “rake migrate” and then  
updated today in hopes it’d fix it and now it’s even worse.

Here’s the error:

/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:477:in  
`const\_missing’: uninitialized constant XSD::NS::KNOWN\_TAG (NameError)

I’m assuming there’s not much I can do about it right now but just  
making sure I’m not doing something wrong…

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [September 30, 2007, 12:35am UTC](https://www.ruby-forum.com/t/script-generate-model-cookbook-yields-const-missing-uninitialized-constant/115889/2 "2007-09-30T00:35:25Z")

</div>

Seems this was caused by soap4r-1.5.8, removing it and using only 1.5.7  
fixed the problem. I happened to do a search and found that someone was  
having problems starting Mongrel if they had 1.5.8 installed so I tried  
it and viola! it worked.

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [September 30, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/script-generate-model-cookbook-yields-const-missing-uninitialized-constant/115889/3 "2007-09-30T23:10:46Z")

</div>

NAKAMURA, Hiroshi wrote:

> and released as a gem. When another module such as REXML, yaml and so  
> on will try to create a gem, same kind of problem must be exposed.
> 
> Workaround of this ActiveSupport + RubyGems problem;
> 
> 1. declaring soap4r gem (‘gem “soap4r”’) before Rails tries to load any  
> features, or
> 2. sudo rm -rf /usr/local/lib/ruby/1.8/{soap,wsdl,xsd}

The second option seems to work for me and I’ll simply leave it that way  
until they come up with something better.

I suspected it had something to do with either ActiveSupport or  
ActiveRecord(both kept appearing in errors after I’d execute ‘rake  
db:migrate’)

Hope this is fixed soon as I’m too new to Ruby to diagnose this type of  
incompatibility.

---

<div class="post-metadata">

**Author:** ![miracleofmagick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Post date:** [September 30, 2007, 3:29am UTC](https://www.ruby-forum.com/t/script-generate-model-cookbook-yields-const-missing-uninitialized-constant/115889/4 "2007-09-30T03:29:33Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi,

Eric H. wrote:

> Seems this was caused by soap4r-1.5.8, removing it and using only 1.5.7  
> fixed the problem. I happened to do a search and found that someone was  
> having problems starting Mongrel if they had 1.5.8 installed so I tried  
> it and viola! it worked.

soap4r-1.5.6, soap4r-1.5.7 did not work as expected, too.

The problem is caused by;

- Ruby’s feature loading system (Kernel#require), plus
- RubyGems’ hacking to control the feature loading scheme, plus
- Rails’ hacking to improve performance of the feature loading

It’s caused by ActiveSupport + RubyGems, and soap4r just hits the  
problem. For now soap4r is the only module that is bundled with Ruby  
and released as a gem. When another module such as REXML, yaml and so  
on will try to create a gem, same kind of problem must be exposed.

Workaround of this ActiveSupport + RubyGems problem;

1. declaring soap4r gem (‘gem “soap4r”’) before Rails tries to load any  
features, or
2. sudo rm -rf /usr/local/lib/ruby/1.8/{soap,wsdl,xsd}

Regards,  
// NaHi

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRv77Zh9L2jg5EEGlAQIVpggAtAOO63eva5paqDSOGIzju/yDgUgUrhER  
Adv+WsOnaoohuzPkse3gvtbfNeGQZqti6fQ5kGqaEmgOZM0XYuqaY+h3N07SRNFD  
biUy8VIAhVeVdGJ8pCWbspfSYpfb7lp+WJPGsF+pmIoceQJalZf16/YxoYJULOhY  
6OkiKT4L/h/A6bLKOrOjj3OqqLUXm2KDb8cBYmQbgCUPkBDqyeWF5QtXI2iAKNRb  
P4P1OQ2WzQCv4eWO+u8XhgVjmXfuZVAYhRhXrzWs0KO4j2BhIhnYjN0Yoaun+s5y  
mwA26iqtpxC2a1a7zd6fppl6Uocwl8BJSNO3kCf5oKqJ9ScStCgqvg==  
=fEue  
-----END PGP SIGNATURE-----
