所以,我尝试将我的Laravel项目部署到Heroku。
在我的Vendor文件夹中,我安装了Jeffrey Way的Generators [/ Vendor / Way]。似乎Heroku没有它。我得到以下内容,我运行git push heroku master
Initializing repository, done.
Counting objects: 88, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (73/73), done.
Writing objects: 100% (88/88), 34.47 KiB | 0 bytes/s, done.
Total 88 (delta 4), reused 0 (delta 0)
-----> PHP app detected
-----> No runtime requirements in composer.json, defaulting to PHP 5.6.1.
-----> Installing system packages...
- PHP 5.6.1
- Apache 2.4.10
- Nginx 1.6.0
-----> Installing PHP extensions...
- zend-opcache (automatic; bundled, using 'ext-zend-opcache.ini')
-----> Installing dependencies...
Composer version 73e9db5d9952d52a46ecbc20a269a8c5f9c5b011 2014-10-07 15:03:19
Loading composer repositories with package information
Installing dependencies from lock file
- Installing symfony/translation (v2.5.5)
Downloading: 100%
- Installing symfony/security-core (v2.5.5)
Downloading: 100%
- Installing symfony/routing (v2.5.5)
Downloading: 100%
- Installing symfony/process (v2.5.5)
Downloading: 100%
- Installing symfony/http-foundation (v2.5.5)
Downloading: 100%
- Installing symfony/event-dispatcher (v2.5.5)
Downloading: 100%
- Installing symfony/debug (v2.5.5)
Downloading: 100%
- Installing psr/log (1.0.0)
Downloading: 100%
- Installing symfony/http-kernel (v2.5.5)
Downloading: 100%
- Installing symfony/finder (v2.5.5)
Downloading: 100%
- Installing symfony/dom-crawler (v2.5.5)
Downloading: 100%
- Installing symfony/css-selector (v2.5.5)
Downloading: 100%
- Installing symfony/console (v2.5.5)
Downloading: 100%
- Installing symfony/browser-kit (v2.5.5)
Downloading: 100%
- Installing swiftmailer/swiftmailer (v5.3.0)
Downloading: 100%
- Installing stack/builder (v1.0.2)
Downloading: 100%
- Installing predis/predis (v0.8.7)
Downloading: 100%
- Installing phpseclib/phpseclib (0.3.8)
Downloading: 100%
- Installing patchwork/utf8 (v1.1.25)
Downloading: 100%
- Installing nesbot/carbon (1.13.0)
Downloading: 100%
- Installing monolog/monolog (1.11.0)
Downloading: 100%
- Installing nikic/php-parser (v0.9.5)
Downloading: 100%
- Installing jeremeamia/superclosure (1.0.1)
Downloading: 100%
- Installing ircmaxell/password-compat (1.0.3)
Downloading: 100%
- Installing filp/whoops (1.1.2)
Downloading: 100%
- Installing d11wtq/boris (v1.0.8)
Downloading: 100%
- Installing symfony/filesystem (v2.5.5)
Downloading: 100%
- Installing classpreloader/classpreloader (1.0.2)
Downloading: 100%
- Installing laravel/framework (v4.2.11)
Downloading: 100%
Generating optimized autoload files
PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in /tmp/build_5ed58964-00a1-4095-976d-3975a31d73d8/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Way\\Generators\\GeneratorsServiceProvider' not found","file":"\/tmp\/build_5ed58964-00a1-4095-976d-3975a31d73d8\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php","line":157}}Script php artisan clear-compiled handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in /tmp/build_5ed58964-00a1-4095-976d-3975a31d73d8/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
install [--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] [packages1] ... [packagesN]
! Push rejected, failed to compile PHP app
To git@heroku.com:tranquil-shore-5073.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:tranquil-shore-1111.git'
为什么会这样?我该如何解决? 非常感谢!
答案 0 :(得分:1)
所以这是我的指南如何在Homestead中做到这一点。
$ vagrant ssh
$ cd Code/webdev.local
] $ composer require way/generators --dev
[您实际上可以跳过此步骤]
"require-dev": {
"way/generators": "dev-master"
}
]
$composer update
'providers'=>array('Way\Generators\GeneratorsServiceProvider'),
php artisan
检查命令
对我来说工作得很好!