【问题标题】:Deploying Laravel to Heroku - problems with Jeffrey Way's Generators将 Laravel 部署到 Heroku - Jeffrey Way 的生成器的问题
【发布时间】:2014-10-11 11:24:54
【问题描述】:

所以,我正在尝试将我的 Laravel 项目部署到 Heroku。 在我的供应商文件夹中,我安装了 Jeffrey Way 的发电机 [/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'

为什么会这样?我该如何解决? 非常感谢!

【问题讨论】:

  • 好的,我自己想通了。这是我安装这些生成器的问题:我没有使用环境。下一条评论是这样做的指南:)

标签: heroku laravel push


【解决方案1】:

所以这是我的指南,如何在 Homestead 中进行操作。


1. 打开终端并执行$ vagrant ssh
2. 将目录更改为您的项目[例如:$ cd Code/webdev.local]
3.运行$ composer require way/generators --dev[其实可以跳过这一步]
4.将项目的 composer.json "way/generators" 更新为 "dev-master" 或 "2.*" 或 "~3.0" - 取决于您的 larval 版本 [例如:
"require-dev": {
        "way/generators": "dev-master"
    }

]


5.Run $composer update
6. 导航到你的项目和 app/config/local/app.php (如果你没有本地文件夹 - 创建它然后创建 app.php 开始像app.php) 并在那里设置'providers'=>array('Way\Generators\GeneratorsServiceProvider'),
7. 运行php artisan 以检查命令

对我来说工作得很好!

【讨论】:

    猜你喜欢
    • 2014-08-24
    • 2021-08-21
    • 1970-01-01
    • 2011-06-10
    • 1970-01-01
    • 2021-10-29
    • 2013-02-08
    • 2018-11-09
    • 2021-12-04
    相关资源
    最近更新 更多