0

I'm new in using 'pgsql' as my default Database Connection name. I followed the tutorial here. https://mattstauffer.co/blog/laravel-on-heroku-using-a-postgresql-database

I set the variable before the return array.

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

And this is my database setting.

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

I'm trying to deploy my Laravel app to Heroku. I'm using Laravel 4.2.* now in my composer. I tried Laravel 4.1.* also but errors are the same.

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'

I tried to run composer update in my localhost but there are no errors. I tried to deploy a fresh install of Laravel 5 app but there are no errors.

2 Answers 2

1

This is because there is an error in the composer.lock file. Somewhere along the way the repository for classpreloader moved to a new place. Since the entry points to the old place it tries, but fails. I think heroku do not follow the redirect to the new place.

For an easy fix, swap

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

to

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

in your composer.lock file

Sign up to request clarification or add additional context in comments.

1 Comment

I simply deleted my vendor folder, ran a composer update, and the problem was fixed. Generally I avoid editing the composer.lock file, since it can change on future updates. Whatever the case, this answer helped me to fix the problem, so thank you. :)
0

Simply delete your vendor/ folder and your composer.lock file. Then run composer install again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.