开发者

The has_many_polymorphs plugin is giving me this error

This is the error in my logs when I try to create a new model:

/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.r开发者_如何学Cb: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

It's from the has_many_polymorphs plugin...

here is config/environment.rb:

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

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

This is /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


The quick answer:

Your has_many_polymorphs plugin is broken. And I think you've included it in your environment.rb file on LINE 5

UPD

as you can see /rubyprograms/dreamstill/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb:23 there is an error in has_many_polymorphs.rb file n line 23. Fix it :D. Or don't use broken plugins.

rails plugin remove has_many_polymorphs
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜