Bug #3866
"DEPRECATION WARNING: metaclass is deprecated and will be removed from Rails 2.3"
| Status: | Closed | Start date: | 05/24/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | testing | |||
| Target version: | 2.6.0 | |||
| Affected Puppet version: | 0.25.4 | Branch: | http://github.com/mmrobins/puppet/tree/bug/master/3866-metaclass_deprecation | |
| Keywords: | ||||
| Votes: | 3 |
Description
Rails’s active_support is conflicting with metaid.rb (which we vendor) in the implementation of Object#metaclass . Their implementation has historically been compatible with ours, but recently they throw a deprecation warning.
History
Updated by Adam Gibbins almost 2 years ago
- Priority changed from Low to Normal
I get a variation on this, which is VERY noisy (repeated 50+ times at the beginning of everything puppet related):
DEPRECATION WARNING: metaclass is deprecated and will be removed from Rails 2.3 (use singleton_class instead). (called from meta_eval at /usr/lib/ruby/1.8/puppet/util/metaid.rb:4)
A fix for this would be appreciated fairly quickly due to the verbosity of this.
Puppet: 0.25.5 Ruby: 4.2 ActiveRecord: 2.3.8 ActiveSupport: 2.3.8
Updated by Matt Robinson almost 2 years ago
- Category set to testing
- Status changed from Accepted to In Topic Branch Pending Review
- Branch set to http://github.com/mmrobins/puppet/tree/bug/0.25.x/3866-metaclass_deprecation
Changing the name of that method to be what rails and ruby-core call it, which after lots of debate turned out to be singleton_class. I like eigenclass better, but don’t care enough to diverge from what the rest of the community wants to call it.
Updated by James Turnbull almost 2 years ago
- Target version changed from 52 to 2.6.0
Updated by Markus Roberts almost 2 years ago
- Status changed from In Topic Branch Pending Review to Closed
Added to master in commit:b5f14c6eeaaf8cc70287f3b1b2f74441157ac4b6 {#3866] Rename the method metaclass to singleton_class to avoid the deprecation
Updated by James Turnbull almost 2 years ago
Also backported to 0.25.x in commit:8faa4663a4d79de47886755693f5539d531bd1f8 in branch 0.25.x
Updated by James Turnbull almost 2 years ago
- Status changed from Closed to Re-opened
- Assignee set to Matt Robinson
Still got a few of these:
.DEPRECATION WARNING: metaclass is deprecated and will be removed from Rails 2.3 (use singleton_class instead). (called from ./spec/unit/util/logging.rb:79) .DEPRECATION WARNING: metaclass is deprecated and will be removed from Rails 2.3 (use singleton_class instead). (called from ./spec/unit/util/logging.rb:79) .DEPRECATION WARNING: metaclass is deprecated and will be removed from Rails 2.3 (use singleton_class instead). (called from ./spec/unit/util/logging.rb:79) .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................***.......................................................................................................Skipping unsuitable example group Puppet::Rails when initializing any connection on ActiveRecord 2.1.x: ActiveRecord 2.1.x ....................................................DEPRECATION WARNING: metaclass is deprecated and will be removed from Rails 2.3 (use singleton_class instead). (called from ./spec/unit/parser/scope.rb:68) .DEPRECATION WARNING: metaclass is deprecated and will be removed from Rails 2.3 (use singleton_class instead). (called from ./spec/unit/parser/scope.rb:75)
This is on master.
Updated by Matt Robinson almost 2 years ago
- Status changed from Re-opened to Ready For Checkin
- Branch changed from http://github.com/mmrobins/puppet/tree/bug/0.25.x/3866-metaclass_deprecation to http://github.com/mmrobins/puppet/tree/bug/master/3866-metaclass_deprecation
This new branch should only be applied to master to fix the few remaining cases where metaclass needs to be renamed to singleton_class.
Updated by Gary Larizza almost 2 years ago
I applied this patch to a Snow Leopard (10.6.4) machine (downloaded tarball to a directory, ran the install.rb) and Ralsh fails with the following —> http://pastie.org/1016472 When I re-install the 0.25.5 master, ralsh works. Can anyone confirm this? Maybe I just installed incorrectly.
Updated by Matt Robinson almost 2 years ago
Gary, I can’t duplicate the problem you’re having with Ralsh. I even finally let my Mac restart so I could upgrade to 10.6.4 to try test the same thing. When you’re calling ralsh, what type are you passing in? If you search the patched code for do you find metaclass anywhere?
Updated by Gary Larizza almost 2 years ago
Matt, I may have “patched” my machine incorrectly. Incidentally, I’m running 10.6.4 Server – forgot to mention this (not that it matters much). What I did was pull down the source from http://github.com/mmrobins/puppet/tree/bug/master/3866-metaclass_deprecation – I then changed to that directory and ran “ruby install.rb” as root (with a sudo -s first). Doing this is probably not recommended – I should have just pulled a diff in and changed just the necessary code. See here (http://pastie.org/1016679). Like I said – I think I’m doing it wrong (but let me know one way or another!) :)
Edit: Duh – I pulled the whole branch. I checked out the commit here (http://github.com/mmrobins/puppet/commit/b7f697dfde83004f3824ca946fe4ae4a801c57d8) and will make the changes. Sorry for the false alarm.
Updated by Matt Robinson almost 2 years ago
Hi Gary, Been busy working on getting 2.6 ready for release, so haven’t gotten through my email queue recently. There’s really no reason to install this patch unless you’re doing development work as all it does is get rid of some deprecation warnings. I’m not really sure what the problem might be, but if you want to test patches it’s probably best to be running puppet from a git checkout of the code. Instruction on how to do this can be found here http://projects.puppetlabs.com/projects/puppet/wiki/Development_Development_Lifecycle. Otherwise, you’ll want to delete the install directories of puppet before you run install.rb again. Not sure what might happen if you install over the top of an older version. Matt
Updated by Nick Lewis almost 2 years ago
The last of these warnings were killed off as a part of commit:2baf74e71d97f0e9917b088279cb0540e37c022c in master.
Updated by Nick Lewis almost 2 years ago
- Status changed from Ready For Checkin to Closed
Updated by Daniel Pittman about 1 month ago
- Assignee deleted (
Matt Robinson)