I am getting --Gem::Exception: can't activate facets (= 2005.10.15),
already activated facets-0.7.2] -- when I require, say,
'facet/enumerable/probability' (irb stack trace below)
I've got the lastest version of facets (2005.10.15) installed ('gem
list facet' gives me
facets(2005.10.15, 2005.10.11, 0.7.2, 0.7.1, 0.7.0)) and I have a
bunch of other gems installed including rails' activesupport, which I
see is in the stack track.
What is causing my Gem::Exception?
Thanks!
Brian
------------------------
irb(main):011:0> require 'facet/enumerable/probability'
Gem::Exception: can't activate facets (= 2005.10.15), already activated facets-0
7.2]
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:149:in `activate'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:26:in `re
quire'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.1/lib/active_suppo
rt/dependencies.rb:213:in `require'
from (irb):11
This is really a bad mojo on Gems. But we won't get into that.
The question is what's cuasing the old version of facets to be active.
I wonder if I have an autorequire set for 0.7.2 in the gemspec, would
that do it? I don't think I do though. Another thought: are you running
Nitro 0.23 by chance?
T.
I discovered my gem error goes away when I remove one of the require
lines in my irb configure file but I haven't yet figured out what the
specific code that is causing the conflict is. I'm not even sure what
I should be looking for -- following each and every require in the
whole require tree may get tedious.
> Nitro 0.23 by chance?
I'm not running Nitro.
T.
The require I removed had been a file that contained more requires
which in turn had more requires, etc... a whole require tree. But
now I've isolated the problem to facet/array/each_permutation
require 'facet/array/each_permutation'
require 'facet/enumerable/probability'
These two lines back to back cause my gem exception.
Looking at the gems, I see that facet/array/each_permutation is not
part of the current facet(2005.10.15) but it is in facet(0.7.2).
Any explanation on what's happening here appreciated.
--Brian
PS One more fact, possibly related. My system also has the "nano" gem
installed (0.9.2,0.8.2) which looks like a near copy of the facets gem
and I even see facets has a directory called nano. What is the
relationship between the facet gem and the nano gem?
I see. Gems is activating 0.7.2 b/c #each_permutation is defined as an
array method in 0.7.2, but in the latest version it has been moved to
enumerable. So change to:
require 'facet/enumerable/each_permutation'
require 'facet/enumerable/probability'
> PS One more fact, possibly related. My system also has the "nano" gem
> installed (0.9.2,0.8.2) which looks like a near copy of the facets gem
> and I even see facets has a directory called nano. What is the
> relationship between the facet gem and the nano gem?
I will explain better soon in offical announcemnt of new Facets, after
I finish final todos. But the short of it is simply this: I had changed
name to Nano Methods, but after recieveing a great deal of email about
Facets, I decided it better to keep Facets name. The project is quite
broad now, so currently nano/ dir serves to sort out the methods part
of it, mega/ the modules part and facet/ dir contains redirects to all
parts.
So the thing to do now is to:
gem uninstall nano
gem uninstall mega (if you have this too)
With Facets you can use either:
require 'facet/...'
or
require 'nano/...' # for methods
require 'mega/...' # for modules
Either will work.
T.
P.S. The upcoming release that I am finsihing off now will makes things
a lot smoother in that it has better interface and will automatically
search inheritance chain for matching method.
Thank you, this does solve my problem.
> So the thing to do now is to:
>
> gem uninstall nano
> gem uninstall mega (if you have this too)
I ran these two uninstalls as you advised. While doing the uninstalls
I got a dependency warning that glue-0.23 depends on mega. I
proceeded anyway (since I'm not aware how or if I was using glue and
will hopefully be able to resolve any dependency issues when or if I
ever have to).
> P.S. The upcoming release that I am finsihing off now will makes things
> a lot smoother in that it has better interface and will automatically
> search inheritance chain for matching method.
T, thanks for your help and thanks for the great facets gem!