Forum: Ruby on Rails Problems with flickr gem: already initialized constant

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris T (Guest)
on 2006-02-07 14:24
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
=> 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?
Chris T (Guest)
on 2006-02-08 20:17
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
> => 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?
Victor T. (Guest)
on 2006-02-14 00:17
(Received via mailing list)
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> 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/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Victor T.
http://nsi-group.net
removed_email_address@domain.invalid
AIM: victolbert
(678) 613-3400
Chris T (Guest)
on 2006-02-21 15:47
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> 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/.
>> _______________________________________________
>> Rails mailing list
>> removed_email_address@domain.invalid
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>
>
> --
> Victor T.
> http://nsi-group.net
> removed_email_address@domain.invalid
> AIM: victolbert
> (678) 613-3400
This topic is locked and can not be replied to.