title: Install Mongoid with Rails 3.2.2
body: <p>i'm trying to use Mongoid with rails 3.2.2, i've added:</p>
  
  <pre><code>gem "mongoid", "~&gt; 2.4"
  gem "bson_ext", "~&gt; 1.5"
  </code></pre>
  
  <p>to my gemfile, run:</p>
  
  <pre><code>bundle install
  </code></pre>
  
  <p>then</p>
  
  <pre><code>rails g mongoid:config
  </code></pre>
  
  <p>then edited my application.rb so:</p>
  
  <pre><code>#require "active_record/railtie" commented because of mongoid
  require "action_controller/railtie"
  require "action_mailer/railtie"
  require "active_resource/railtie"
  require "sprockets/railtie"
  </code></pre>
  
  <p>and i have mongoid.yml:</p>
  
  <pre><code>development:
    host: localhost
    database: boards_development
  
  test:
    host: localhost
    database: boards_test
  
  # set these environment variables on your prod server
  production:
    host: &lt;%= ENV['MONGOID_HOST'] %&gt;
    port: &lt;%= ENV['MONGOID_PORT'] %&gt;
    username: &lt;%= ENV['MONGOID_USERNAME'] %&gt;
    password: &lt;%= ENV['MONGOID_PASSWORD'] %&gt;
    database: &lt;%= ENV['MONGOID_DATABASE'] %&gt;
    # slaves:
    #   - host: slave1.local
    #     port: 27018
    #   - host: slave2.local
    #     port: 27019
  </code></pre>
  
  <p>I've deleted databse.yml as is said on mongoid docs but when running rails server I get error like this:</p>
  
  <pre><code>matteo@matteo-stable:~/Matteo/Dev/boards$ rails s
  =&gt; Booting WEBrick
  =&gt; Rails 3.2.2 application starting in development on http://0.0.0.0:3000
  =&gt; Call with -d to detach
  =&gt; Ctrl-C to shutdown server
  Exiting
  /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `active_record' for #&lt;Rails::Application::Configuration:0x8eb762c&gt; (NoMethodError)
      from /home/matteo/Matteo/Dev/boards/config/environments/development.rb:26:in `block in &lt;top (required)&gt;'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:24:in `class_eval'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:24:in `configure'
      from /home/matteo/Matteo/Dev/boards/config/environments/development.rb:1:in `&lt;top (required)&gt;'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `block in require'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/engine.rb:571:in `block in &lt;class:Engine&gt;'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
      from /home/matteo/Matteo/Dev/boards/config/environment.rb:5:in `&lt;top (required)&gt;'
      from /home/matteo/Matteo/Dev/boards/config.ru:4:in `require'
      from /home/matteo/Matteo/Dev/boards/config.ru:4:in `block in &lt;main&gt;'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
      from /home/matteo/Matteo/Dev/boards/config.ru:1:in `new'
      from /home/matteo/Matteo/Dev/boards/config.ru:1:in `&lt;main&gt;'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/commands/server.rb:46:in `app'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/commands/server.rb:70:in `start'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/commands.rb:55:in `block in &lt;top (required)&gt;'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/commands.rb:50:in `tap'
      from /home/matteo/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.2/lib/rails/commands.rb:50:in `&lt;top (required)&gt;'
      from script/rails:6:in `require'
      from script/rails:6:in `&lt;main&gt;'
  matteo@matteo-stable:~/Matteo/Dev/boards$ rails s
  =&gt; Booting WEBrick
  =&gt; Rails 3.2.2 application starting in development on http://0.0.0.0:3000
  =&gt; Call with -d to detach
  =&gt; Ctrl-C to shutdown server
  host is not a valid option for Mongo::Connection
  [2012-03-16 20:00:08] INFO  WEBrick 1.3.1
  [2012-03-16 20:00:08] INFO  ruby 1.9.3 (2012-02-16) [i686-linux]
  [2012-03-16 20:00:08] INFO  WEBrick::HTTPServer#start: pid=9936 port=3000
  ^C[2012-03-16 20:01:03] INFO  going to shutdown ...
  [2012-03-16 20:01:03] INFO  WEBrick::HTTPServer#start done.
  Exiting
  </code></pre>
  
  <p>leaving the line about active record i don't get any error but this:</p>
  
  <pre><code>host is not a valid option for Mongo::Connection
  </code></pre>
  
  <p>should i install something other?</p>