2015-03-08 161 views
0

我新使用'pgsql'作为我的默认数据库连接名称。我在这里跟着教程。 https://mattstauffer.co/blog/laravel-on-heroku-using-a-postgresql-database将Laravel应用程序部署到Heroku时的错误

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

$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 [email protected]: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: '.'                  

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

我试图在本地主机上运行composer更新,但没有错误。我试图部署全新安装的Laravel 5应用程序,但没有任何错误。

回答

1

这是因为composer.lock文件中存在错误。一路上,classpreloader的存储库移到了新的地方。由于入口指向它尝试的旧地方,但失败。我认为heroku不会遵循重定向到新的地方。

对于一个简单的办法,换

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

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

在composer.lock文件

+0

我只是删除了我的供应商文件夹,运行了一个'composer update',问题就解决了。通常我会避免编辑'composer.lock'文件,因为它可以改变未来的更新。无论如何,这个答案帮助我解决了这个问题,所以谢谢。 :) – Jonathan 2015-03-17 15:02:52

0

只是删除vendor/文件夹和文件composer.lock。然后再次运行composer install

相关问题