# Problems with flickr gem: already initialized constant

**URL:** <https://www.ruby-forum.com/t/problems-with-flickr-gem-already-initialized-constant/102006>\
**Category:** Rails\
**Created:** [February 7, 2006, 1:24pm UTC](https://www.ruby-forum.com/t/problems-with-flickr-gem-already-initialized-constant/102006 "2006-02-07T13:24:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [February 7, 2006, 1:24pm UTC](https://www.ruby-forum.com/t/problems-with-flickr-gem-already-initialized-constant/102006/1 "2006-02-07T13:24:23Z")

</div>

New to rails so please bear with me. Am having difficulties with the  
flickr plugin. trying to follow the video as a starter, and keep hitting  
the following problem when I require ‘flickr’ in the environment.rb file

testbed:/srv/www/htdocs/carstuff # ruby script/server  
=\> Booting WEBrick…  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:274:  
warning: already initialized constant KNOWN\_OPTIONS  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:279:  
warning: already initialized constant DEF\_KEY\_ATTRIBUTES  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:280:  
warning: already initialized constant DEF\_ROOT\_NAME  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:281:  
warning: already initialized constant DEF\_CONTENT\_KEY  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:282:  
warning: already initialized constant DEF\_XML\_DECLARATION  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:283:  
warning: already initialized constant DEF\_ANONYMOUS\_TAG  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:284:  
warning: already initialized constant DEF\_FORCE\_ARRAY  
/usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:285:  
warning: already initialized constant DEF\_INDENTATION  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2006-02-07 11:49:20] INFO WEBrick 1.3.1  
[2006-02-07 11:49:20] INFO ruby 1.8.4 (2005-12-24) [i686-linux]  
[2006-02-07 11:49:20] INFO WEBrick::HTTPServer#start: pid=13394  
port=3000

Thought it was possibly to do with the Ruby RPM (Suse 9.3), so got rid  
of that and installed Ruby 1.8.4 from source. Didn’t make any  
difference. Anybody got any clues?

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [February 8, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/problems-with-flickr-gem-already-initialized-constant/102006/2 "2006-02-08T19:17:57Z")

</div>

OK. Have now tested this on a Debian box. Installed Ruby from source,  
rubygems, then rails and finally flickr/xml-simple.

– Set up new project: rails flickrtest  
– Ran webrick – all OK  
– added require ‘flickr’ to environment.rb  
– Suddenly getting these same errors.

Anyone got any ideas?

Chris T wrote:

> New to rails so please bear with me. Am having difficulties with the  
> flickr plugin. trying to follow the video as a starter, and keep hitting  
> the following problem when I require ‘flickr’ in the environment.rb file
> 
> testbed:/srv/www/htdocs/carstuff # ruby script/server  
> =\> Booting WEBrick…  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:274:  
> warning: already initialized constant KNOWN\_OPTIONS  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:279:  
> warning: already initialized constant DEF\_KEY\_ATTRIBUTES  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:280:  
> warning: already initialized constant DEF\_ROOT\_NAME  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:281:  
> warning: already initialized constant DEF\_CONTENT\_KEY  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:282:  
> warning: already initialized constant DEF\_XML\_DECLARATION  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:283:  
> warning: already initialized constant DEF\_ANONYMOUS\_TAG  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:284:  
> warning: already initialized constant DEF\_FORCE\_ARRAY  
> /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:285:  
> warning: already initialized constant DEF\_INDENTATION  
> =\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
> =\> Ctrl-C to shutdown server; call with --help for options  
> [2006-02-07 11:49:20] INFO WEBrick 1.3.1  
> [2006-02-07 11:49:20] INFO ruby 1.8.4 (2005-12-24) [i686-linux]  
> [2006-02-07 11:49:20] INFO WEBrick::HTTPServer#start: pid=13394  
> port=3000
> 
> Thought it was possibly to do with the Ruby RPM (Suse 9.3), so got rid  
> of that and installed Ruby 1.8.4 from source. Didn’t make any  
> difference. Anybody got any clues?

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [February 13, 2006, 11:17pm UTC](https://www.ruby-forum.com/t/problems-with-flickr-gem-already-initialized-constant/102006/3 "2006-02-13T23:17:40Z")

</div>

I get the same error, Chris, has this issue been resolved for you? If  
so, how did you fix.

Thanks.

I am using Ruby 1.8.2, Rails 1.0, flickr 1.0, and xml-simple 1.08 on  
Mac OS X 10.4.4

On 2/8/06, Chris T [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Chris T wrote:
> 
> > /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:280:  
> > warning: already initialized constant DEF\_INDENTATION
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Victor T.  
[http://nsi-group.net](http://nsi-group.net)  
removed\_email\_address@domain.invalid  
AIM: victolbert  
(678) 613-3400

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [February 21, 2006, 2:47pm UTC](https://www.ruby-forum.com/t/problems-with-flickr-gem-already-initialized-constant/102006/4 "2006-02-21T14:47:54Z")

</div>

Victor  
Got this email from the author a couple of days ago…

It looks to me like there aren’t any errors int that output, just  
warnings, so that shouldn’t keep your app from working. I suspect both  
Rails and Flickr.rb are requiring XmlSimple, and so the constants are  
getting defined twice. Or something like that.

Anyhow, I’m afraid that I haven’t been able to maintain Flickr.rb very  
well, so it’s likely fallen apart in places. There are a couple of  
other Flickr-Ruby projects that may be more actively maintained.  
Sorry!

Scott

Knowing I could ignore the warnings, managed to work out where I was  
going wrong – sloppy typing, mainly – and as Scott suggested, it  
worked just fine. Haven’t had time to try and work out how to avoid  
calling XmlSimple twice. Hope this helps – CT

Victor T. wrote:

> I get the same error, Chris, has this issue been resolved for you? If  
> so, how did you fix.
> 
> Thanks.
> 
> I am using Ruby 1.8.2, Rails 1.0, flickr 1.0, and xml-simple 1.08 on  
> Mac OS X 10.4.4
> 
> On 2/8/06, Chris T [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Chris T wrote:
> > 
> > > /usr/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:280:  
> > > warning: already initialized constant DEF\_INDENTATION
> > 
> > –  
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > * * *
> > 
> > Rails mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> –  
> Victor T.  
> [http://nsi-group.net](http://nsi-group.net)  
> removed\_email\_address@domain.invalid  
> AIM: victolbert  
> (678) 613-3400
