0

これは、新しいモデルを作成しようとしたときのログのエラーです。

/rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/configuration.rb:7: Configuration is not a class (TypeError)
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
    from /rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb:23
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
    from /rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/init.rb:2
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/plugin.rb:81
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:25:in `instance_exec'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:25:in `run'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:50:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:49:in `each'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:49:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:134:in `initialize!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:77:in `send'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:77:in `method_missing'
    from /rubyprograms/dreamstill/config/environment.rb:5
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:103:in `require'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:103:in `require_environment!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.4/lib/rails/commands.rb:16
    from script/rails:6:in `require'
    from script/rails:6

これは、has_many_polymorphsプラグインからのものです...

ここにconfig/environment.rbがあります:

# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Dreamstill::Application.initialize!

これは/rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/configuration.rb

module Rails #:nodoc:
  class Configuration

    def has_many_polymorphs_options
      ::HasManyPolymorphs.options
    end

    def has_many_polymorphs_options=(hash)
      ::HasManyPolymorphs.options = HashWithIndifferentAccess.new(hash)
    end

  end  
end
4

1 に答える 1

1

簡単な答え:

プラグhas_many_polymorphsインが壊れています。そして、あなたはそれをLINE5のenvironment.rbファイルに含めたと思います

UPD

ご覧のとおり、ファイルnの23行目/rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb:23にエラーがあります。修正してください:D。has_many_polymorphs.rbまたは、壊れたプラグインを使用しないでください。

rails plugin remove has_many_polymorphs
于 2011-04-24T01:52:41.220 に答える