redinger / validation_reflection

This plugin adds reflective access to validations
http://rubygems.org/gems/validation_reflection
MIT License
296 stars 18 forks source link

broken in rails 2.3.9 #10

Closed denro closed 6 years ago

denro commented 14 years ago

I get this error on 2.3.9 after runnig "rake gems:install RAILS_ENV=test"

downgrading to 0.3.8 solves this

rake aborted!
undefined method `on_load' for ActiveSupport:Module
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/validation_reflection-1.0.0/lib/validation_reflection.rb:99
/Users/denro/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Users/denro/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:184:in `require'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/validation_reflection-1.0.0/rails/init.rb:2:in `evaluate_init_rb'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/rails/plugin.rb:158:in `evaluate_init_rb'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/activesupport-2.3.9/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/rails/plugin.rb:154:in `evaluate_init_rb'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/rails/plugin.rb:48:in `load'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/rails/plugin/loader.rb:38:in `load_plugins'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/rails/plugin/loader.rb:37:in `each'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/rails/plugin/loader.rb:37:in `load_plugins'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/initializer.rb:369:in `load_plugins'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/initializer.rb:165:in `process'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/initializer.rb:113:in `send'
/Users/denro/.rvm/gems/ruby-1.8.7-p302@richiehawtin/gems/rails-2.3.9/lib/initializer.rb:113:in `run'
/Users/denro/workspace/richiehawtin/config/environment.rb:9
pupeno commented 14 years ago

I'm getting this on Rails 2.3.10, but it worked on 2.3.9.

pupeno commented 14 years ago

The problem seems to be upgrading to validation_reflection 1.0.0. The previous version, 0.3.8 works fine n both Rails 2.3.9 and 2.3.8.

iva2k commented 14 years ago

Strange, but I'm getting this problem on Rails 2.3.5. Anyone can share their insight on what is actually going on?

pupeno commented 14 years ago

iva2k, I'm not totally sure, but it seems the problem was introduced in validation_relfection 1.0.0, so if you use 0.3.8 you should be fine in any version of Rails 2.3. Maybe validation_reflection 1.0.0 is for Rails 3.0 (but then Rails includes it's own relfection in version 3).

Just do

gem "validation_reflection", "~>0.3.8"

if you are using bundler or

config.gem "validation_relfection", :version => "~>0.3.8"

or something like that if are not.

But really, upgrade Rails, there's no reason not to; and use bundler, there's no reason not to.

iva2k commented 14 years ago

Thanks for the instructions. Unfortunately I cannot update the rails version (yet). I already used the downrev to work around the problem after reading an earlier comment here.

The insight I'm looking for is what has changed in validation_reflection code to cause the problem, and potentially a fix for it.

gamov commented 13 years ago

Count me in, same error. Rails 2.3.10 / Ruby 1.8.6

shedd commented 13 years ago

Locking validation_reflection to 0.3.8 with Bundler fixed the issue for me with Rails 2.3.11

betelgeuse commented 13 years ago

Please change the gemspec to have dependencies on rails >=3 so that bundler will not pull 1.0.0 with rails 3.

ktec commented 12 years ago

yes please update and republish gem to prevent this error.