Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1891

TypeError: db_name must be a string or symbol

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.4.8
    • Affects Version/s: None
    • Component/s: None
    • None

      See description listed below. Thanks.

      # ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
      # Sinatra
      
      Mongoid.configure do |config|
       name = "development"
       host = "localhost"
       
       config.master = Mongo::Connection.from_uri("mongodb://#{host}:27017",:logger => Logger.new(STDOUT)).db("#{name}")
      end
      
      # ...OR
      
      YAML::ENGINE.yamler = 'syck'
       
      configure do
       Mongoid.load!("config/mongoid.yml")
      end
      
      defaults: &defaults
        host:localhost
        allow_dynamic_fields:false
        autocreate_indexes:false
        raise_not_found_error:true
      
      development:
        <<: *defaults
        database:development
      
      test:
        <<: *defaults
        database:test
      
      #//////////////////////////////////////////////////
      # ERROR
      #
      # > TypeError: db_name must be a string or symbol
      #
      #//////////////////////////////////////////////////
      

      The former produces the error listed above when I run Resque. The later option I'm trying can't even parse the file with the syck parser.

      Suggestions?

            Assignee:
            Unassigned Unassigned
            Reporter:
            dustineichler Dustin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: