2015-03-08 246 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

相關問題