Bug #2508

misleading error about ActiveRecord versions

Added by seph seph almost 3 years ago. Updated over 2 years ago.

Status:Closed Start date:08/06/2009
Priority:Normal Due date:
Assignee:James Turnbull % Done:

0%

Category:Rails
Target version:0.25.1
Affected Puppet version:0.24.8 Branch:
Keywords:
Votes: 0

Description

lib/puppet/defaults.rb raises an error about requiring ActiveRecord 2.3. Luke says this is wrong, that it’s not that version.

I think I’m only hitting it because of #2102 anyhow.

History

Updated by seph seph almost 3 years ago

While the error about 2.3 is wrong, there’s more complexity here. My ubuntu hardy machine has rails 2.0 installed. puppet/feature/rails.rb should detect this as being less than 2.1, but instead it incorrect thinks there’s no activerecord.

Poking at rails.rb, it looks like this is because activerecord 2.0 doesn’t export the ActiveRecord::VERSION things without active_record/version having been required:

{{{ root@puppet1:~# irb1.8 irb(main):001:0> $: << “/usr/share/rails/activerecord/lib” => [“/usr/local/lib/site_ruby/1.8”, “/usr/local/lib/site_ruby/1.8/x86_64-linux”, “/usr/local/lib/site_ruby”, “/usr/lib/ruby/1.8”, “/usr/lib/ruby/1.8/x86_64-linux”, “.”, “/usr/share/rails/activerecord/lib”] irb(main):002:0> require ‘active_record’ => true irb(main):003:0> ::ActiveRecord::VERSION NameError: uninitialized constant ActiveRecord::VERSION

from /usr/share/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:266:in `load_missing_constant'
from /usr/share/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in `const_missing'
from (irb):3
from :0

irb(main):004:0> require ‘active_record/version’ => [] irb(main):005:0> ::ActiveRecord::VERSION => ActiveRecord::VERSION }}}

Updated by James Turnbull almost 3 years ago

  • Category set to Rails
  • Status changed from Unreviewed to Accepted
  • Target version set to 0.25.0

Updated by Luke Kanies almost 3 years ago

  • Status changed from Accepted to Ready For Checkin
  • Assignee set to James Turnbull

Fixed in my tickets/master/2508 branch.

Updated by James Turnbull almost 3 years ago

  • Status changed from Ready For Checkin to Closed

Pushed in commit:1a5c5b3fdbcf705d1fcd16f8f26e2b0f85b9e160 in branch master.

Updated by Todd Zullinger over 2 years ago

  • Status changed from Closed to Re-opened

I believe this problem still exists. As seph mentioned, ActiveRecord < 2.3.0 does not autoload active_record/version. This causes puppet to fail to start when storeconfigs is enabled with the error: Could not parse configuration file: StoreConfigs not supported without ActiveRecord 2.1 or higher, even though ActiveRecord-2.1.1 is installed. I’ve sent a “patch”:http://groups.google.com/group/puppet-dev/browse_thread/thread/29f8781a81bfd94b to puppet-dev and pushed it to git://jet.mox.net/~tmz/puppet.git on the tickets/master/2508 branch.

Updated by James Turnbull over 2 years ago

  • Target version changed from 0.25.0 to 0.25.1

Updated by Markus Roberts over 2 years ago

  • Status changed from Re-opened to In Topic Branch Pending Review

Updated by James Turnbull over 2 years ago

  • Status changed from In Topic Branch Pending Review to Closed

Pushed in commit:1494bd7e53a87d2cb75a23f78f4178975790199d in branch 0.25.x

Also available in: Atom PDF