Rails 4.2.3 `method_missing ': undefined method` active_record'

I tried to create a new Rails application today and the application behaves as if ActiveRecord just doesn't exist.

I created an app with

rails new myapp --database=mysql

      

When I run rake db: create, I get:

rake aborted!
NoMethodError: undefined method `active_record' for #<Rails::Application::Configuration:0x007faad08b3058>
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.3/lib/rails/railtie/configuration.rb:95:in `method_missing'
/Users/richard/Dropbox/Development/myapp/config/application.rb:24:in `<class:Application>'
/Users/richard/Dropbox/Development/myapp/config/application.rb:10:in `<module:Myapp>'
/Users/richard/Dropbox/Development/myapp/config/application.rb:9:in `<top (required)>'
/Users/richard/Dropbox/Development/myapp/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

      

In fact, if I comment out the offending line and then run rake -T:

...
rake cache_digests:dependencies         # Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_c...
rake cache_digests:nested_dependencies  # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_commen...
rake doc:app                            # Generate docs for the app -- also available doc:rails, doc:guides (options: TEM...
rake log:clear                          # Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=t...
rake middleware
...

      

There are no rake db: * tasks at all!

I have many other Rails applications from Rails 3.x to Rails 4.2.0 and they all work fine. It is only this application created today (and any new application) that demonstrates this behavior.

Running OSX 10.10, Ruby 2.0.0, completely preserves the Gemfile.

application.rb:

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 Myapp
  class Application < 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 & 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

      

+1


source to share


1 answer


Version 6.0.1 of the isl gem seems to be causing this issue, it was updated yesterday on 7/10/15. https://rubygems.org/gems/arel/versions/6.0.1

== Update ==

Today the author addressed the issue with 6.0.2. https://github.com/rails/arel/issues/375



Run:

bundle update

      

+1


source







All Articles