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

PHP Fatal error: Uncaught Error: Class 'Consolidation\Cgr\SystemInformation' not found in ~/.config/composer/vendor/consolidation/cgr/bin/cgr.php:17 #31

Open
86me opened this issue Aug 31, 2018 · 1 comment

Comments

@86me
Copy link

86me commented Aug 31, 2018

Followed the installation instructions, added "~/.config/composer/vendor/bin" to my $PATH, then tried running cgr and get this error

PHP Fatal error:  Uncaught Error: Class 'Consolidation\Cgr\SystemInformation' not found in /home/86me/.config/composer/vendor/consolidation/cgr/bin/cgr.php:17
Stack trace:
#0 /home/86me/.config/composer/vendor/consolidation/cgr/bin/cgr(5): main(Array)
#1 {main}
  thrown in /home/86me/.config/composer/vendor/consolidation/cgr/bin/cgr.php on line 17

This is line 17 of cgr.php

$home = \Consolidation\Cgr\SystemInformation::getHomeDir();

What am I missing?

OS: Arch
Composer version 1.7.2 2018-08-16 16:57:12

@greg-1-anderson
Copy link
Member

Looks like your global autoloader does not include the cgr classes. You could try composer global dumpautoload, or maybe remove and re-add cgr.

Would it be preferable if cgr were provided as a phar? The installation instructions would then be:

  1. Download the phar from github
  2. chmod +x it
  3. Rename it to cgr and move it to your PATH (or symlink)

Updates would thereafter be done via cgr self:update (although cgr rarely needs updating).

The current installation method is just one line (if folks have already put the Composer global vendor bin in their path), but it seems that it has occasionally been unreliable for folks, and I'm not sure why. Maybe the phar would be more straightforward.

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

2 participants