SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Warning Messages creating rails app

    Hi,

    I'm running ruby 1.8.7 and rails 2.1.0 on ubuntu linux 9.04. When I run the rails command to create a new application and also the ruby/script server command from the terminal window, I get the following message:

    /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 Mongrel (use 'script/server webrick' to force WEBrick)

    Any idea what this means?

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)
    What it means?

    I have Ruby 1.8 In my installation, xmlsimple.rb is in ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/xml-simple-1.0.11
    The file is the XmlSimple class and has
    Code Ruby:
      private
     
      # Declare options that are valid for xml_in and xml_out.
      KNOWN_OPTIONS = {
        'in'  => %w(
          keyattr keeproot forcecontent contentkey noattr
          searchpath forcearray suppressempty anonymoustag
          cache grouptags normalisespace normalizespace
          variables varattr keytosymbol
        ),
        'out' => %w(
     
          keyattr keeproot contentkey noattr rootname
          xmldeclaration outputfile noescape suppressempty
          anonymoustag indent grouptags noindent
        )
      }
     
      # Define some reasonable defaults.
      DEF_KEY_ATTRIBUTES  = []
      DEF_ROOT_NAME       = 'opt'
      DEF_CONTENT_KEY     = 'content'
      DEF_XML_DECLARATION = "<?xml version='1.0' standalone='yes'?>"
      DEF_ANONYMOUS_TAG   = 'anon'
      DEF_FORCE_ARRAY     = true
      DEF_INDENTATION     = '  '
      DEF_KEY_TO_SYMBOL   = false
    If these constants are already initialized, then my guess is that either this file is being called twice, or there is more than one version of it and both are getting called.

    The server message indicates that Mongrel is being used as the server, and if you want WEBrick to be the server to - use 'script/server webrick' - on the command line.

    Sorry I don't know the exact "why" or "what to do", but I guess if it's running OK I wouldn't worry about it too much for now depending on what you're working on. That is, don't let it stop you from working with Ruby, but when you get a chance look into it some more.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll keep going then (developing my very first rails app), just didn't want to continue if it was going to mean a headache for me down the road.

    Thanks,

    Veronica

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A possible solution here:

    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


    haven't tried yet though, maybe in the morning...

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Resolved by updating rails and ruby to latest versions.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •