Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Base class package "Class::Accessor" is empty #5

Open
danielcavanagh opened this issue Jun 28, 2022 · 5 comments
Open

error: Base class package "Class::Accessor" is empty #5

danielcavanagh opened this issue Jun 28, 2022 · 5 comments

Comments

@danielcavanagh
Copy link

this is on macos 12.4

> perl -W -MNeovim::Ext -e ''
Base class package "Class::Accessor" is empty.
    (Perhaps you need to 'use' the module which defines that package first,
    or make that module available in @INC (@INC contains: /Users/dcavanagh1/perl5/lib/perl5/darwin-thread-multi-2level /Users/dcavanagh1/perl5/lib/perl5 /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0 /usr/local/lib/perl5/site_perl/5.34.0).
 at /Users/dcavanagh1/perl5/lib/perl5/Neovim/Ext.pm line 5.
BEGIN failed--compilation aborted at /Users/dcavanagh1/perl5/lib/perl5/Neovim/Ext.pm line 5.
Compilation failed in require.
BEGIN failed--compilation aborted.

yet...

> cpanm Class::Accessor
Class::Accessor is up to date. (0.51)

any ideas?

@jacquesg
Copy link
Owner

Seems like you have the PERL5LIB environment variable set, and it looks like you are mixing 2 different perl installations's modules (the version numbers are the same, but their build options may differ) i.e.

/usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0
/usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0

and

/usr/local/lib/perl5/site_perl/5.34.0

@danielcavanagh
Copy link
Author

Hmm. /usr/local/lib/perl5/site_perl/5.34.0 doesn't seem to exist at all. /usr/local/lib/perl5/5.34.0/ does and everything inside it is symlinked to /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0, so they seem to be the same

PERL5LIB == /Users/dcavanagh1/perl5/lib/perl5, however I've tried unsetting it and I'm still getting the same issue

I believe cpanm is installing to /Users/dcavanagh1/perl5/lib/perl5 and I can see the Class::Accessor and Neovim::Ext packages there

I've just tried removing all of perl and its packages and reinstalling everything. I tried cpanm Neovim::Ext but the tests failed. cpanm -n Neovim::Ext worked fine. I have the original error still

Any other ideas?

@danielcavanagh
Copy link
Author

Feel free to close this if you think it's just cause of something funny in my environment. It's not important to me so I'm going to give up. Cheers

@jacquesg
Copy link
Owner

I'm honestly not sure why this isn't working for you. Have you tried using a perl from perlbrew?

@huyz
Copy link

huyz commented Nov 8, 2022

I ran into the same error on Linux, so this may or may not help you.
It turns out I was using the system cpanm from apt. If instead, I install cpanm from my user account using: curl -L https://cpanmin.us | perl - App::cpanminus all the environment is consistent and I don't get that error anymore.

Now, on macOS, I also got errors, albeit different from the one you stated, if I do brew install cpananimus. Again, I had to resort to installing the recommended manufacturer way and it worked:

curl -L https://cpanmin.us | perl - App::cpanminus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants