2014-10-11 61 views
0

所以,我正在嘗試將我的Laravel項目部署到Heroku。 在我的Vendor文件夾中,我安裝了Jeffrey Way的Generators [/ Vendor/Way]。 Heroku似乎沒有它。我收到以下磨牀git push heroku master部署Laravel到Heroku - Jeffrey Way的發電機問題

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 [email protected]:tranquil-shore-5073.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:tranquil-shore-1111.git' 

爲什麼會發生?我該如何解決它? 非常感謝!

+0

好吧,我自己想通了。這是我安裝這些發生器時遇到的一個問題:我沒有使用環境。下一個評論是做到這一點的指導:) – eZo 2014-10-11 16:01:19

回答

1

所以這裏是我的指導如何在Homestead中做到這一點。


1.打開終端並做 $ vagrant ssh
2.將目錄更改到您的項目[例如: $ cd Code/webdev.local]
3.運行 $ composer require way/generators --dev [實際上你可以跳過這一步]
4.更新項目的composer.json「方式/發電機」改爲「 DEV-主」或 「2 *」 或 「〜3.0」 - 這取決於你的幼蟲版本[例如:

"require-dev": { 
     "way/generators": "dev-master" 
    } 

]


5.Run $composer update
6.導航到您的項目和應用程序/配置/本地/ app.php(如果你沒有本地文件夾 - 創建它,然後創建app.php開始像app.php)並設置那裏 'providers'=>array('Way\Generators\GeneratorsServiceProvider'),
7.運行 php artisan檢查命令

對我來說工作得很好!