Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8720285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:00:21+00:00 2026-06-13T07:00:21+00:00

I am getting an error when I start my rails development server. I run

  • 0

I am getting an error when I start my rails development server. I run rails 3.0.6 and ruby 1.8.7 (2012-06-29 patchlevel 370) [i686-linux]

The console output is like this when I execute rails s

=> Booting Mongrel
=> Rails 3.0.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
host is not a valid option for Mongo::Connection

My main concern is this error “host is not a valid option for Mongo::Connection”. I integrate devise 1.5.2 to run Facebook, Twitter and LinkedIn login via Omniauth and this mongoDB error is appearing now.

The GemFile I use in this Rails App.

source 'http://rubygems.org'

gem 'rails', '3.0.6'
gem 'rake', '0.8.7'

gem 'mysql'
gem 'mysql2', "0.2.11"

gem 'mongrel'
gem 'jquery-rails', '>= 0.2.7' 
gem 'active_scaffold_vho' 
gem 'inherited_resources', '~> 1.2.1' 
gem 'has_scope', '~> 0.5.0' 
gem 'json_pure' 
gem 'formtastic', '~> 1.2.3' 
gem "devise", "1.5.2"
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-linkedin'
gem 'omniauth-openid'
gem 'recaptcha', :require => 'recaptcha/rails' 

gem 'uuidtools', '~> 2.1.2'

gem 'capistrano', '~> 2.6.0' 

gem 'cgi_multipart_eof_fix'
gem 'fastthread'

gem 'mongoid', "~>2.0" #Mongoid
gem 'bson_ext', "~>1.3" #Mongoid

gem 'redis', "~> 2.2.0"
gem 'resque'
gem 'resque-scheduler'

gem 'SystemTimer', "~> 1.2.3" 

gem 'ar_mailer_rails3' 
gem 'lazy_high_charts', "~> 1.1.1" 

gem 'rails-breadcrumbs', "~> 1.0.0"

gem 'curb' 

gem 'geonames', "~> 0.2.2" 

gem 'activemerchant'

gem 'savon', "~> 0.9.7"

gem 'rack-ssl'
gem 'state_machine'

gem "http_accept_language", '~> 1.0.2'

gem 'recurly', '~> 2.1.0'
gem 'newrelic_rpm'

group :test, :development do
  gem 'rspec-rails', "~> 2.8"
  gem 'rspec-mocks', "~> 2.8"
  gem 'capybara', "~> 0.4.1.2"
  gem 'database_cleaner', "~> 0.6.7 "
  gem 'cucumber', "~> 0.10.2"
  gem 'spork', "~> 0.9.0"
  gem 'launchy', "~> 0.4.0"
  gem 'machinist', "~> 1.0.6"
  gem 'factory_girl_rails', "1.3.0"
  gem 'faker', "~> 0.9.5"
  gem 'email_spec'  
  gem 'rails-erd'  
  gem 'ruby-debug'
end

group :development do
  gem "hirb"
  gem "awesome_print"
end

The mongoid.yml file is as follows:

defaults: &defaults
  host: localhost
  database: teenscrio

development:
  <<: *defaults
  database: teenscrio_dev

staging:
  <<: *defaults
  database: teenscrio_stg

test:
  <<: *defaults
  database: teenscrio_tst

# set these environment variables on your prod server
production:
  host: <%= ENV['MONGOID_HOST'] %>
  port: <%= ENV['MONGOID_PORT'] %>
  username: <%= ENV['MONGOID_USERNAME'] %>
  password: <%= ENV['MONGOID_PASSWORD'] %>
  database: <%= ENV['MONGOID_DATABASE'] %>

Why this error is appearing now? What is the relation between devise and mongoid? How can I fix this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:00:22+00:00Added an answer on June 13, 2026 at 7:00 am

    You need to reconsider how your initializing Mongo::Connection. You seem to be supplying the host incorrectly in the options, whereas it has to be passed directly to the initializer or specified in the environment.

    I’m assuming there’s some difference between your development and production environment with regards to how your constructing your MongoDB connection that’s leading to the exception your encountering.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to start rails console I keep getting the following error Users/rigelstpierre/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/irb/completion.rb:9:in `require':
When I try to start my Rails server, I am getting the following error:
I'm trying to start my rails server with rails server. I am getting the
immediately after has_many_polymorphs install with ruby script/plugin install git://github.com/fauna/has_many_polymorphs.git i start getting following error
I'm getting ExecJS::RuntimeError when i try to start Rails server and the server log
getting error while try to start service
I'm getting an error message of ORA-00936: missing expression at the very start of
Getting the following error when trying to start a session: Warning: session_start() [function.session-start]: Node
I am getting an illegal start of type error at the first nested if
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.