将Laravel应用程序部署到Heroku时出错

时间:2015-03-08 17:34:42

标签: postgresql laravel heroku composer-php

我在使用' pgsql'作为我的默认数据库连接名称。我在这里按照教程。 https://mattstauffer.co/blog/laravel-on-heroku-using-a-postgresql-database

我在返回数组之前设置变量。

$pgSql = parse_url(getenv("DATABASE_URL"));

这是我的数据库设置。

    'pgsql' => array(
        'driver'   => 'pgsql',
        'host'     => $pgSql["host"],
        'database' => substr($pgSql["path"], 1),
        'username' => $pgSql["user"],
        'password' => $pgSql["pass"],
        'charset'  => 'utf8',
        'prefix'   => '',
        'schema'   => 'public',
    ),

我试图将我的Laravel应用程序部署到Heroku。我现在在我的作曲家中使用Laravel 4.2。*。我尝试过Laravel 4.1。*但也有错误。

git push heroku master
Initializing repository, done.
Counting objects: 23559, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11992/11992), done.
Writing objects: 100% (23559/23559), 12.41 MiB | 106.00 KiB/s, done.
Total 23559 (delta 11526), reused 22306 (delta 11163)

-----> Fetching custom git buildpack... done
-----> PHP app detected
-----> No runtime required in composer.json, defaulting to PHP 5.6.6.
-----> Installing system packages...
       - PHP 5.6.6
       - Apache 2.4.10
       - Nginx 1.6.0
-----> Installing PHP extensions...
       - zend-opcache (automatic; bundled)
-----> Installing dependencies...
       Composer version 1.0-dev (3470cef1f1294802bdc2885e152d28537f643828) 2015-03-05 14:44:34
       Loading composer repositories with package information
       Installing dependencies from lock file
         - Installing cartalyst/sentry (2.1.x-dev 0ae4158)
           Downloading: connection...
           Downloading: 0%
           Downloading: 5%
           Downloading: 10%
           Downloading: 20%
           Downloading: 25%
           Downloading: 30%
           Downloading: 35%
           Downloading: 45%
           Downloading: 50%
           Downloading: 55%
           Downloading: 60%
           Downloading: 70%
           Downloading: 75%
           Downloading: 80%
           Downloading: 85%
           Downloading: 95%
           Downloading: 100%

         - Installing symfony/finder (2.5.x-dev e527ebf)
           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: 90%
           Downloading: 95%
           Downloading: 100%

         - Installing symfony/filesystem (2.7.x-dev d4ae276)
           Downloading: connection...
           Downloading: 0%
           Downloading: 15%
           Downloading: 80%
           Downloading: 95%
           Downloading: 100%

         - Installing symfony/console (2.5.x-dev a43e750)
           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 nikic/php-parser (0.9.x-dev ef70767)
           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 classpreloader/classpreloader (1.0.2)
           Downloading: connection...
           Failed to download classpreloader/classpreloader from dist: The "https://api.github.com/repos/mtdowling/ClassPreloader/zipball/2c9f3bcbab329570c57339895bd11b5dd3b00877" file could not be downloaded (HTTP/1.1 404 Not Found)
           Now trying to download from source
         - Installing classpreloader/classpreloader (1.0.2)
           Cloning 2c9f3bcbab329570c57339895bd11b5dd3b00877



         [RuntimeException]                                                                                    
         Failed to clone git@github.com:mtdowling/ClassPreloader.git via git, https, ssh protocols, aborting.  

         - git://github.com/mtdowling/ClassPreloader.git                                                       
           Cloning into '/tmp/build_b341becfc2b77828db949186d5d78624/vendor/classpreloader/classpreloader'...  
           fatal: Not a git repository: '.'                                                                    

         - https://github.com/mtdowling/ClassPreloader.git                                                     
           Cloning into '/tmp/build_b341becfc2b77828db949186d5d78624/vendor/classpreloader/classpreloader'...  
           fatal: Not a git repository: '.'                                                                    

         - git@github.com:mtdowling/ClassPreloader.git                                                         
           Cloning into '/tmp/build_b341becfc2b77828db949186d5d78624/vendor/classpreloader/classpreloader'...  
           Host key verification failed.                                                                       
           fatal: Could not read from remote repository.                                                       

           Please make sure you have the correct access rights                                                 
           and the repository exists.                                                                          




       install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]



 !     Push rejected, failed to compile PHP app

To git@heroku.com:quizmodule.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:quizmodule.git'

我尝试在localhost中运行composer update,但没有错误。我尝试部署全新安装的Laravel 5应用程序,但没有错误。

2 个答案:

答案 0 :(得分:1)

这是因为composer.lock文件中存在错误。在此过程中,classpreloader的存储库移动到了一个新的位置。由于入口指向它尝试的旧地方,但失败了。我认为heroku不会跟随重定向到新的地方。

为了方便解决,请交换

"url": "https://github.com/mtdowling/ClassPreloader.git"

"url": "https://github.com/ClassPreloader/ClassPreloader.git"
你的composer.lock文件中的

答案 1 :(得分:0)

只需删除您的=INT($F3/3)文件夹和vendor/文件即可。然后再次运行composer.lock