Развертывание приложения Symfony2 на Heroku

Я пытаюсь развернуть приложение symfony2 на heroku, и я получаю эту ошибку:

-----> PHP app detected
-----> Resolved composer.lock requirement for PHP >=5.3.3 to version 5.6.2.
-----> Installing system packages...
- PHP 5.6.2
- Apache 2.4.10
- Nginx 1.6.0
-----> Installing PHP extensions...
- zend-opcache (automatic; bundled, using 'ext-zend-opcache.ini')
-----> Installing dependencies...
Composer version 1.0-dev (ffffab37a294f3383c812d0329623f0a4ba45387) 2014-11-05 06:04:18
Loading composer repositories with package information
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
- Installing doctrine/lexer (v1.0)
Downloading: connection...    Downloading: 0%               Downloading: 80%    Downloading: 100%

- Installing doctrine/annotations (v1.2.1)
Downloading: connection...    Downloading: 0%               Downloading: 10%    Downloading: 15%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 55%    Downloading: 65%    Downloading: 70%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%

- Installing doctrine/cache (v1.3.1)
Downloading: connection...    Downloading: 0%               Downloading: 20%    Downloading: 25%    Downloading: 40%    Downloading: 45%    Downloading: 65%    Downloading: 90%    Downloading: 95%    Downloading: 100%

- Installing doctrine/inflector (v1.0)
Downloading: connection...    Downloading: 0%               Downloading: 55%    Downloading: 100%

- Installing doctrine/collections (v1.2)
Downloading: connection...    Downloading: 0%               Downloading: 35%    Downloading: 70%    Downloading: 100%

- Installing doctrine/common (v2.4.2)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%

- Installing doctrine/data-fixtures (dev-master ac36ccc)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 100%

- Installing twig/twig (v1.16.2)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%    Downloading: 100%

- Installing psr/log (1.0.0)
Downloading: connection...    Downloading: 0%               Downloading: 15%    Downloading: 30%    Downloading: 45%    Downloading: 60%    Downloading: 75%    Downloading: 100%

- Installing symfony/symfony (v2.5.6)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%    Downloading: 100%

- Installing jdorn/sql-formatter (v1.2.17)
Downloading: connection...    Downloading: 0%               Downloading: 10%    Downloading: 35%    Downloading: 45%    Downloading: 80%    Downloading: 95%    Downloading: 100%

- Installing doctrine/dbal (v2.4.3)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%    Downloading: 100%

- Installing doctrine/doctrine-bundle (v1.2.0)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 100%

- Installing doctrine/doctrine-fixtures-bundle (dev-master 9a5b528)
Downloading: connection...    Downloading: 0%               Downloading: 15%    Downloading: 30%    Downloading: 100%

- Installing doctrine/orm (v2.4.6)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%    Downloading: 100%

- Installing incenteev/composer-parameter-handler (v2.1.0)
Downloading: connection...    Downloading: 0%               Downloading: 25%    Downloading: 50%    Downloading: 75%    Downloading: 100%

- Installing knplabs/knp-components (1.3.1)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 100%

- Installing knplabs/knp-paginator-bundle (2.4.1)
Downloading: connection...    Downloading: 0%               Downloading: 20%    Downloading: 40%    Downloading: 60%    Downloading: 80%    Downloading: 100%

- Installing knplabs/knp-snappy (0.2.1)
Downloading: connection...    Downloading: 0%               Downloading: 35%    Downloading: 70%    Downloading: 100%

- Installing knplabs/knp-snappy-bundle (dev-master 4e5a2cf)
Downloading: connection...    Downloading: 0%               Downloading: 60%    Downloading: 95%    Downloading: 100%

- Installing sensiolabs/security-checker (v2.0.0)
Downloading: connection...    Downloading: 0%               Downloading: 90%    Downloading: 100%

- Installing sensio/distribution-bundle (v3.0.8)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 95%    Downloading: 100%

- Installing sensio/framework-extra-bundle (v3.0.2)
Downloading: connection...    Downloading: 0%               Downloading: 15%    Downloading: 30%    Downloading: 40%    Downloading: 45%    Downloading: 55%    Downloading: 60%    Downloading: 70%    Downloading: 75%    Downloading: 85%    Downloading: 90%    Downloading: 100%

- Installing kriswallsmith/assetic (v1.2.0)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%

- Installing symfony/assetic-bundle (v2.5.0)
Downloading: connection...    Downloading: 0%               Downloading: 10%    Downloading: 20%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 70%    Downloading: 80%    Downloading: 90%    Downloading: 100%

- Installing monolog/monolog (1.11.0)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%    Downloading: 100%

- Installing symfony/monolog-bundle (v2.6.1)
Downloading: connection...    Downloading: 0%               Downloading: 15%    Downloading: 40%    Downloading: 55%    Downloading: 70%    Downloading: 85%    Downloading: 100%

- Installing swiftmailer/swiftmailer (v5.3.0)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 10%    Downloading: 15%    Downloading: 20%    Downloading: 25%    Downloading: 30%    Downloading: 35%    Downloading: 40%    Downloading: 45%    Downloading: 50%    Downloading: 55%    Downloading: 60%    Downloading: 65%    Downloading: 70%    Downloading: 75%    Downloading: 80%    Downloading: 85%    Downloading: 90%    Downloading: 95%    Downloading: 100%    Downloading: 100%

- Installing symfony/swiftmailer-bundle (v2.3.7)
Downloading: connection...    Downloading: 0%               Downloading: 5%    Downloading: 25%    Downloading: 30%    Downloading: 55%    Downloading: 60%    Downloading: 85%    Downloading: 90%    Downloading: 100%

- Installing twig/extensions (v1.2.0)
Downloading: connection...    Downloading: 0%               Downloading: 10%    Downloading: 20%    Downloading: 30%    Downloading: 75%    Downloading: 100%

Generating optimized autoload files
Creating the "app/config/parameters.yml" file
PHP Fatal error:  Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /tmp/build_634a4dfca497b3cefc3e87e3c0f3c462/app/AppKernel.php on line 30
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException] Произошла ошибка при выполнении команды «cache: clear —no-warmup».

установить [—prefer-source] [—prefer-dist] [—dry-run] [—dev] [—no-dev] [—no-plugins] [—no-custom-installers] [—no-scripts] [—no-progress] [-v | vv | vvv | —verbose] [-o | —optimize-autoloader] [—ignore-platform-reqs] [packages1] .. . [packagesN]

! Push отклонено, не удалось скомпилировать приложение PHPenter code here

1

Решение

Героку бежит composer install --no-dev после нажатия, поэтому никакие пакеты разработки не устанавливаются.

Это означает sensio/generator-bundle должен быть указан в requireне require-dev, в composer.json (бежать composer update потом заново сгенерировать composer.lock а так и коммит оба).

Также убедитесь, что в AppKernel.php что пакет зарегистрирован за пределами if() блок, который работает только в dev и test envs.

3

Другие решения

Существует путаница между dev & prod Режим. Композитор работает как prod режим (например, --no-dev), но ваше приложение пытается работать как dev Режим.

Установить ENV Вар в Героку:

SYMFONY_ENV=prod
2

По вопросам рекламы [email protected]