title: Ruby on Rails `method_missing': undefined method `active_record'
body: <p>I keep having the following error message when i run <code>rails server</code> on my newly created rails project. I created it by running the command <code>rails new toy_app</code>.</p>
  
  <p>Please guide me to how can i solve my problem. I have another rails project and i could run <code>rails server</code> . Is just not possible in my new project.</p>
  
  <p>Error Message</p>
  
  <pre><code>/Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/railtie/configuration.rb:95:in
  `method_missing': undefined method `active_record' for
  #&lt;Rails::Application::Configuration:0x007f9413116e40&gt; (NoMethodError)   from /Users/judobear/toy_app/config/application.rb:24:in
  `&lt;class:Application&gt;'   from
  /Users/judobear/toy_app/config/application.rb:10:in `&lt;module:ToyApp&gt;'
    from /Users/judobear/toy_app/config/application.rb:9:in `&lt;top
  (required)&gt;'  from
  /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in
  `require'   from
  /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in
  `block in server'   from
  /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in
  `tap'   from
  /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in
  `server'  from
  /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in
  `run_command!'  from
  /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in
  `&lt;top (required)&gt;'  from /Users/judobear/toy_app/bin/rails:8:in
  `require'   from /Users/judobear/toy_app/bin/rails:8:in `&lt;top
  (required)&gt;'  from
  /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in
  `load'  from
  /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in
  `call'  from
  /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in
  `call'  from
  /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client.rb:26:in
  `run'   from
  /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/bin/spring:48:in `&lt;top
  (required)&gt;'  from
  /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in
  `load'  from
  /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in
  `&lt;top (required)&gt;'  from
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
  `require'   from
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
  `require'   from /Users/judobear/toy_app/bin/spring:13:in `&lt;top
  (required)&gt;'  from bin/rails:3:in `load'  from bin/rails:3:in `&lt;main&gt;'
  </code></pre>
  
  <p>GemFile</p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails',        '4.2.2'
  gem 'sass-rails',   '5.0.2'
  gem 'uglifier',     '2.5.3'
  gem 'coffee-rails', '4.1.0'
  gem 'jquery-rails', '4.0.3'
  gem 'turbolinks',   '2.3.0'
  gem 'jbuilder',     '2.2.3'
  gem 'sdoc',         '0.4.0', group: :doc
  
  group :development, :test do
    gem 'sqlite3',     '1.3.9'
    gem 'byebug',      '3.4.0'
    gem 'web-console', '2.0.0.beta3'
    gem 'spring',      '1.1.3'
  end
  
  group :production do
    gem 'pg',             '0.17.1'
    gem 'rails_12factor', '0.0.2'
  end
  </code></pre>
  
  <p>Application.rb</p>
  
  <pre><code>require File.expand_path('../boot', __FILE__)
  
  require 'rails/all'
  
  # Require the gems listed in Gemfile, including any gems
  # you've limited to :test, :development, or :production.
  Bundler.require(*Rails.groups)
  
  module Toyapp
    class Application &lt; Rails::Application
      # Settings in config/environments/* take precedence over those specified here.
      # Application configuration should go into files in config/initializers
      # -- all .rb files in that directory are automatically loaded.
  
      # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
      # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
      # config.time_zone = 'Central Time (US &amp; Canada)'
  
      # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
      # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
      # config.i18n.default_locale = :de
  
      # Do not swallow errors in after_commit/after_rollback callbacks.
      config.active_record.raise_in_transactional_callbacks = true
    end
  end
  </code></pre>