facets gem exception

B

Brian Buckley

Hello,

I am getting --Gem::Exception: can't activate facets (=3D 2005.10.15),
already activated facets-0.7.2] -- when I require, say,=20
'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 (=3D 2005.10.15), already activated f=
acets-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:i=
n `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
 
T

Trans

I've gotten these at times. Drives me batty cause I'm not sure what's
causing it either. While I suspect something is requiring an older
version of facets first then you are trying to require against the new
one. But the only way for this bug to happen then is if Gems is being
"too" smart and noticing that this particular facet doesn't exist in
the old version, but does in a new version (which is the case). So
instead of saying "LoadError: no file to load --
facet/enumerable/probability for Facets v0.7.2" It's telling you
you're trying to use a newer version when an older one has alrady been
activated. Make sense?

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.
 
B

Brian Buckley

This is really a bad mojo on Gems.

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.
 
B

Brian Buckley

What did you remove exactly?

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?
 
T

Trans

Brian said:
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.

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.
 
B

Brian Buckley

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'

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top