slimphp-api / slim-api

Command line interface for generating API end points with Slim
MIT License
11 stars 1 forks source link

Uncaught exception for global install of slim-api. Have I done something stupid? #49

Closed jakeBarwell closed 8 years ago

jakeBarwell commented 8 years ago

I am getting the following when running slimapi init api. This is a global composer install.

PHP Warning:  Uncaught exception 'ErrorException' with message 'require(/home/jake/.composer/vendor/slimphp-api/slim-api/bin/../vendor/autoload.php): failed to open stream: No such file or directory' in /home/jake/.composer/vendor/slimphp-api/slim-api/bin/slimapi:7
Stack trace:
#0 /home/jake/.composer/vendor/slimphp-api/slim-api/bin/slimapi(7): {closure}(2, 'require(/home/j...', '/home/jake/.com...', 7, Array)
#1 /home/jake/.composer/vendor/slimphp-api/slim-api/bin/slimapi(7): require()
#2 {main}
  thrown in /home/jake/.composer/vendor/slimphp-api/slim-api/bin/slimapi on line 7
PHP Fatal error:  main(): Failed opening required '/home/jake/.composer/vendor/slimphp-api/slim-api/bin/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/jake/.composer/vendor/slimphp-api/slim-api/bin/slimapi on line 7
gabriel403 commented 8 years ago

Hi @jakeBarwell could you add steps to reproduce this please? Did you git clone or composer require slim-api etc.

Thanks!

jakeBarwell commented 8 years ago
  1. Change into global composer directory ~/.composer or mk if does not exist.
  2. Using the folowing composer file
{
    "minimum-stability": "dev",
    "require": {
        "codeception/codeception": "2.1.*",
        "slimphp-api/slim-api": "@dev"
    }
}
  1. Run composer global update
  2. Composer vendor dir added to path via .bashrc export PATH=~/.composer/vendor/bin:$PATH
  3. Run slimapi init api