2

私のapplication.rb中で私は持っています

config.autoload_paths += %W(
      #{config.root}/lib/middleware 
      #{config.root}/lib 
      #{config.root}/lib/quickbooks/* 
      #{config.root}/lib/**/ 
      #{config.root}/app/models/concerns 
      #{config.root}/app/models/account)

app/models/account呼ばれるファイルnew_account_creation.rbがあり、内容は次のとおりです。

module Account::NewAccountCreation
  extend ActiveSupport::Concern

  included do
  end
end

そして最後に、account.rbモデルファイルには次のものがあります。

class Account < ActiveRecord::Base
  include Account::NewAccountCreation
end

実行するたびにbundle exec rake routes、懸念事項が読み込まれていないかのように、以下のエラーが発生します。行き詰まりました、何が問題なのですか?

rake aborted!
NameError: uninitialized constant Account::NewAccountCreation
/Users/Ackerman/src/Printavo/app/models/account.rb:57:in `<class:Account>'
/Users/Ackerman/src/Printavo/app/models/account.rb:56:in `<top (required)>'
/Users/Ackerman/src/Printavo/lib/tasks/populate.rake:3:in `<top (required)>'
/Users/Ackerman/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.19/lib/rails/engine.rb:425:in `block in load_tasks'
/Users/Ackerman/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.19/lib/rails/engine.rb:425:in `each'
/Users/Ackerman/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.19/lib/rails/engine.rb:425:in `load_tasks'
/Users/Ackerman/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.19/lib/rails/application.rb:145:in `load_tasks'
/Users/Ackerman/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.19/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/Ackerman/src/Printavo/Rakefile:7:in `<top (required)>'
/Users/Ackerman/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/Users/Ackerman/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
4

0 に答える 0