tags:

views:

122

answers:

2

I'm trying to install Moose (a CPAN module) on my Macbook Pro. It finds a dependency on Sub-Name, and when it tries to install this, gets the following error messages. Any idea as to how I can cure this?

  XMATH/Sub-Name-0.04.tar.gz
  /usr/bin/make -- OK
  Running make test
  PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/smoke....Can't load '/private/var/root/.cpan/build/Sub-Name-0.04-ziHbmm/blib/arch/auto/Sub/Name/Name.bundle' for module Sub::Name: dlopen(/private/var/root/.cpan/build/Sub-Name-0.04-ziHbmm/blib/arch/auto/Sub/Name/Name.bundle, 2): no suitable image found.  

Did find:
    /private/var/root/.cpan/build/Sub-Name-0.04-ziHbmm/blib/arch/auto/Sub/Name/Name.bundle: mach-o, but wrong architecture at /opt/local/lib/perl5/5.8.9/darwin-2level/DynaLoader.pm line 230.
 at t/smoke.t line 6
Compilation failed in require at t/smoke.t line 6.

+++ Addendum +++

I tried the suggestion to use the command sudo port install p5-moose

The installation reported success, but a file with "use Moose'" in it, gives:

"Can't load '/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/Class/C3/XS/XS.bundle' for module Class::C3::XS: dlopen(/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/Class/C3/XS/XS.bundle, 1): no suitable image found.  Did find:
    /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/auto/Class/C3/XS/XS.bundle: mach-o, but wrong architecture at /opt/local/lib/perl5/5.8.9/darwin-2level/XSLoader.pm line 73.
 at /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/Class/C3/XS.pm line 48
Compilation failed in require at (eval 5) line 3.

I'm wondering if when I moved from my old machine (pre-Intel) to this one, if binaries got moved that I now need to re-compile. But, if so, how do I do that?

+2  A: 

Did you try installing Sub::Name via CPAN manually?

cpan> install Sub::Name

Also, I prefer to use port [http://www.macports.org/] on Mac to install Perl modules (or for that matter any other Open Source product).

  1. It keeps what came with Mac OS untouched. So if Apple pushes a newer version with their OS updates, it wouldn't break my setup.

  2. I can rollback changes I make with port.

Moose is available on macports and can be installed as:

sudo port install p5-moose

deepakg
+1  A: 

Ouch, you should not have copied a perl installation from one machine to another. It would be much better to start fresh with new installation(s).

I would strongly recommend nuking your macports directory (/opt/local) from orbit and starting over. You can get a list of currently-installed packages with port list installed, but you could start by just installing the major applications that you need immediately, and then install other things later only as you need them.

Ether