1

I created a brand new Laravel 5 project with this short shell script (gist link) and created an app on Fortrabbit to deploy it to. When I checked everything into git and pushed it up I got the below error:

Deployment file:
  not found

Pre-script:
  not found
  0ms

Composer:
  - - -
  Loading composer repositories with package information
  Installing dependencies (including require-dev) from lock file
  Nothing to install or update
  Generating optimized autoload files
  > Illuminate\Foundation\ComposerScripts::postInstall
  > php artisan optimize



    [ErrorException]         
    Undefined index: driver  



  Script php artisan optimize handling the post-install-cmd event returned with error code 1

  - - -


A B O R T E D

  !! Failure in build execution: Failure in composer execution

My composer.json is the default from the Laravel install:

"scripts": {
    "post-root-package-install": [
        "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-install-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postInstall",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "php artisan optimize"
    ]
},

What is causing this error and how do I fix it? Thank you

Connor Leech
  • 18,052
  • 30
  • 105
  • 150
  • check the default database connection in your `config/database.php` – Amr Aly Aug 08 '17 at 03:06
  • Something is missing in _.env_ This may help `echo "DB_CONNECTION=mysql" >> .env` – Axalix Aug 08 '17 at 03:10
  • `'default' => env('DB_CONNECTION', 'mysql'),` is in config/database.php. I added `DB_CONNECTION=mysql` to the deafult env file provided by Fortrabbit, still no go: https://help.fortrabbit.com/install-laravel-5-uni – Connor Leech Aug 08 '17 at 13:36

0 Answers0