# Xmlsimple warning

**URL:** <https://www.ruby-forum.com/t/xmlsimple-warning/152746>\
**Category:** Rails\
**Created:** [November 7, 2008, 1:54am UTC](https://www.ruby-forum.com/t/xmlsimple-warning/152746 "2008-11-07T01:54:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ginty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@ginty](https://www.ruby-forum.com/u/ginty)\
**Post date:** [November 7, 2008, 1:54am UTC](https://www.ruby-forum.com/t/xmlsimple-warning/152746/1 "2008-11-07T01:54:34Z")

</div>

Hi All,

Anyone know how to fix the below warnings which I get when I run most  
if not all of the ./script executables, some googling reveals the odd  
mention of it but I haven’t seen a good fix for it.

It’s not causing any functional issues for me (so far), just damn  
annoying…

Thanks,  
Stephen

stephen@glasgow:~/www/myproj$ ./script/server  
/usr/lib/ruby/1.8/xmlsimple.rb:275: warning: already initialized  
constant KNOWN\_OPTIONS  
/usr/lib/ruby/1.8/xmlsimple.rb:280: warning: already initialized  
constant DEF\_KEY\_ATTRIBUTES  
/usr/lib/ruby/1.8/xmlsimple.rb:281: warning: already initialized  
constant DEF\_ROOT\_NAME  
/usr/lib/ruby/1.8/xmlsimple.rb:282: warning: already initialized  
constant DEF\_CONTENT\_KEY  
/usr/lib/ruby/1.8/xmlsimple.rb:283: warning: already initialized  
constant DEF\_XML\_DECLARATION  
/usr/lib/ruby/1.8/xmlsimple.rb:284: warning: already initialized  
constant DEF\_ANONYMOUS\_TAG  
/usr/lib/ruby/1.8/xmlsimple.rb:285: warning: already initialized  
constant DEF\_FORCE\_ARRAY  
/usr/lib/ruby/1.8/xmlsimple.rb:286: warning: already initialized  
constant DEF\_INDENTATION  
/usr/lib/ruby/1.8/xmlsimple.rb:287: warning: already initialized  
constant DEF\_KEY\_TO\_SYMBOL  
=\> Booting WEBrick…

---

<div class="post-metadata">

**Author:** ![ginty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@ginty](https://www.ruby-forum.com/u/ginty)\
**Post date:** [November 11, 2008, 11:13am UTC](https://www.ruby-forum.com/t/xmlsimple-warning/152746/2 "2008-11-11T11:13:04Z")

</div>

I am also newbies for rails too.  
I found an information at  
[http://www.unwin.org/ruby\_on\_rails/tips/xml\_simple\_already\_initialized\_constant\_warnings.html](http://www.unwin.org/ruby_on_rails/tips/xml_simple_already_initialized_constant_warnings.html)

But this is not solve my problem too.  
I tried to uninstall flickr but it also not solve.

Best try it first.

---

<div class="post-metadata">

**Author:** ![ginty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@ginty](https://www.ruby-forum.com/u/ginty)\
**Post date:** [November 29, 2008, 12:18pm UTC](https://www.ruby-forum.com/t/xmlsimple-warning/152746/3 "2008-11-29T12:18:23Z")

</div>

On Nov 11, 5:29 am, Mathematician [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am also newbies for rails too.  
> I found an information athttp://www.unwin.org/ruby\_on\_rails/tips/xml\_simple\_already\_initialize…
> 
> But this is not solve my problem too.  
> I tried to uninstall flickr but it also not solve.

I found the problem on my system to be slightly different than the one  
described in the link. The  
conflict was due to xmlsimple.rb being included as well as lib/  
xmlsimple.rb which is nothing more  
than a link to the original file.

The following script worked for me:

#!/bin/sh

cd /usr/lib/ruby/1.8  
if [-h lib/xmlsimple.rb]  
then  
mv lib/xmlsimple.rb lib/xmlsimple.rb.old  
mv xmlsimple.rb lib/.  
cat \> xmlsimple.rb \<\<!  
require ‘lib/xmlsimple.rb’  
!  
else  
echo `pwd`/lib/xmlsimple.rb is not a link. Exiting.  
fi

---

<div class="post-metadata">

**Author:** ![ginty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@ginty](https://www.ruby-forum.com/u/ginty)\
**Post date:** [February 28, 2009, 12:34am UTC](https://www.ruby-forum.com/t/xmlsimple-warning/152746/4 "2009-02-28T00:34:22Z")

</div>

Thanks people! The script worked me just fine!

---

<div class="post-metadata">

**Author:** ![ginty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@ginty](https://www.ruby-forum.com/u/ginty)\
**Post date:** [January 21, 2009, 3:50am UTC](https://www.ruby-forum.com/t/xmlsimple-warning/152746/5 "2009-01-21T03:50:13Z")

</div>

Outstanding thanks for the replies guys!

Phil your script fixed it for me, cheers!
