I'm trying to update my Symfony 2 project from 2.1.4 to 2.1.7 using composer and run php composer.phar update as normal, after updating a few dependencies I receive the following error:
[RuntimeException]
Failed to clone http://github.com/fabpot/Twig-extensions via git, https
and http protocols, aborting.
- git://github.com/fabpot/Twig-extensions
fatal: Not a git repository (or any of the parent directories): .git
- https://github.com/fabpot/Twig-extensions
fatal: Not a git repository (or any of the parent directories): .git
- http://github.com/fabpot/Twig-extensions
fatal: Not a git repository (or any of the parent directories): .git
I've checked the URL and can confirm that it exists, I'm also able to git clone it without any issues from the same CLI.
What's odd is if I run php composer.phar update twig/extensions separately it seems to update without a problem.
This typically happens if you have an old symfony copy that shipped with the vendors installed as git repos but with the git repos removed. To fix it you should just remove the vendor directory so they will reinstall from scratch as git clones or as zip archives, but without any previous assumptions.
Note that currently, I experience a similar issue while using composer with hhvm and PHP 7.
[RuntimeException]
Failed to execute git checkout 'hash' -- && git reset --hard 'hash' --
fatal: Not a git repository (or any of the parent directories): .git
The error appears depending on the composer.json not always but rather regularly. I switch off hhvm to get it working.
Related
I am trying to update my wp submodule to 4.7.2 (I use capistrano to deploy).
I am able to update locally but when I deploy to staging or production I get the following error:
git stdout: Nothing written
git stderr: From github.com:WordPress/WordPress
9bf3844..d333018 master -> origin/master
fatal: reference is not a tree: 1ea8e9a4f03f425a6a77c3487528fedd3f33c100
Unable to checkout '1ea8e9a4f03f425a6a77c3487528fedd3f33c100' in submodule path 'wordpress/wp'
But that tree must exist for it to be working locally right?
Any ideas of what direction I should be looking in? Or better yet a solution!
Thanks
N
I needed to delete my repo from the server and then redeploy. Seemed to have an issue with the submodule in the Capistrano routine.
THanks
I have a little problem to setup Symfony 2 on Cloudcontrol,
I followed the instructions and installed a Symfony 2 framework, changed the document root and so on.
Now when I try to push the changes to server server, it loads the dependencies from the composer.json and then it failed with a message :
[RuntimeException]
Could not scan for classes inside "/srv/tmp/builddir/code/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs" which does not appear to be a file nor a folder
This file is a vendor package, loaded from composer.
I have the same effect with a default composer.json file from a sample project (SF2)
Localy it works very well!
Can some one give me a hint ?
Got same error after setting "minimum-stability":"dev" and running composer update.
for unknown reason symfony/symfony (dev-master ...) kept failing to download from source thus was being loaded from cache.
what worked for me was a mix of previous answers:
$ rm -rf vendor/symfony
$ composer clearcache
$ composer install
Sometimes I had to clean composer cache to remove strange errors, usually it's in
/home/user/.composer/cache
You can also try to update composer with
php composer.phar self-update
I hope it runs for you.
I had the exact same error in my development directory.
What fixed it was :
$ rm -rf vendor/symfony
$ php composer.phar install
It reinstalled symfony/symfony, symfony/icu, symfony/assetic-bundle, symfony/monolog-bundle and symfony/swiftmailer-bundle and now everything works !
I install Symfony 2.3.0-DEV this way:
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
But, Every time I've had to rename (ie. to "test2") the project folder. My installation breaks and shows errors:
Warning: require_once(C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache' (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
I tried, deleting cache folders, deleting the bootstrap.cache.php file, and re-installing/updating vendors, including the autoloader, also with cache:warmup and cache:clear, changing permissions. And still nothing...
Finally solved it ! That's what I've done.
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
Loaded http://localhost/symfony-projects/test1/web/app_dev.php once.
Closed the browser (chrome), stopped xampp (apache/mysql), and the powershell
Deleted /app/cache/* and /app/bootstrap.php.cache file
Closed the IDE, Logoff my user session in Windows 8 (starting feeling paranoid)
Renamed the folder test1 to test2
Executed composer update command to call post-update-cmd scripts to be sure that bootstrap.php.cache is rebuild
Went to http://localhost/symfony-projects/test2/web/app_dev.php
And then works. Probably that issue was due to locked files...
#Touki Thanks, the APC thing was a good insight but not needed it ;)
this topic is quite old but I just had the same problem. The problem was: I installed symfony2 using command:
php composer.phar create-project symfony/framework-standard-edition myProject 2.1.x-dev
but I had the same fatal error. However, my solution was to go myProject directory and run command:
composer update
And that is all, project was rebuilded and file "bootstrap.php.cache" appeard :)
I hope this helps.
Next time, just restart your machine.
I am trying to install my Symfony2 app on koding.com
Trying to install my vendors via php composer.phar update, I run into the following issue, installing doctrine/orm:
Installing doctrine/orm (2.3.x-dev 4d9f24b)
Cloning 4d9f24b2eef3af3a3e76c773994c19bbb0706f88
[ErrorException]
chmod(): No such file or directory
I tried to debug with -v and found out that the following line is causing this issue:
composer.phar/src/Composer/Installer/LibraryInstaller.php:217
In there I see that this issue is related to the bin directory. I have set (S2 default) the bin-dir to "bin". The bin directory is also in place within my project, but somehow composer does not find it, when trying to change the chmod. I have used this setup on several windows machines and also on c9.io.
Issue resolved due to fix on github: https://github.com/composer/composer/issues/1270
So far, the bundles I've used for Symfony2 has been installed modifying the deps file and then running the command bin/vendors install, but for this bundle (WhiteOctoberPagerfantaBundle) the installation process is made using git submodule add command which I don't fully understand.
git submodule add http://github.com/whiteoctober/Pagerfanta.git vendor/pagerfanta
git submodule add http://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git vendor/bundles/WhiteOctober/PagerfantaBundle
I assume that this command retrieves the master version of both libraries, but the documentation says that if I'm using Symfony 2.0.x (which is my case) I should get the symfony2.0 branch:
"Note: If you are using a 2.0.x release of Symfony2, please use the symfony2.0 branch of this bundle. The master branch of this bundle tracks the Symfony2 master branch."
How should I modify the git commands to get the symfony2.0 branch instead of the master? Why some bundles are installed using the deps files while others uses git submodules? What is the difference?
You can still use bin/vendors and the deps system to install these bundles/vendors
in deps
[Pagerfanta]
git=http://github.com/whiteoctober/Pagerfanta.git
target=/pagerfanta
[WhiteOctoberPagerfantaBundle]
git=http://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git
target=/bundles/WhiteOctober/PagerfantaBundle
version=origin/symfony2.0
And re-run bin/vendors install