2015-02-11 88 views
0

我开始了我的一个Fedora客人的symfony项目,并且愉快地编码了好几次。然后,我已经将我的文件导出到亚马逊EC2虚拟机,感谢koding.com并在那里编码了一段时间(这很方便)。我最终希望能够从任何环境编写代码,以便设置git并将所有文件保存在那里。与git供应商克隆的Symfony项目没有安装

昨天,我从github将我的存储库克隆到我的Fedora guest中,并试图启动它。它不适用于某些供应商库没有安装。

我读过文档,这是正常的,在克隆一个存储库之后,必须执行php composer.phar install。

我做过尝试,但由于供应商库在我的AppKernel声明我得到一个错误信息

php composer.phar install 
Loading composer repositories with package information 
Installing dependencies (including require-dev) from lock file 
Nothing to install or update 
Generating autoload files 
Updating the "app/config/parameters.yml" file 
PHP Fatal error: Class 'FOS\UserBundle\FOSUserBundle' not found in /home/eagle1/www/ICORECO/app/AppKernel.php on line 29 

所以我想评论这行,但很明显,我得到了扩展这一类,所以再次作曲家安装生成代码出错

php composer.phar install 
Loading composer repositories with package information 
Installing dependencies (including require-dev) from lock file 
Nothing to install or update 
Generating autoload files 
Updating the "app/config/parameters.yml" file                       [LogicException]                    
    Bundle "NRtworksSubscriptionBundle" extends bundle "FOSUserBundle", which is not registered. 

我该怎么办?

这是我的.gitignore

# Cache and logs (Symfony2) 
/app/cache/* 
/app/logs/* 
!app/cache/.gitkeep 
!app/logs/.gitkeep 
# Cache and logs (Symfony3) 
/var/cache/* 
/var/logs/* 
!var/cache/.gitkeep 
!var/logs/.gitkeep 
# Parameters 
/app/config/parameters.yml 
/app/config/parameters.ini 
# Managed by Composer 
/app/bootstrap.php.cache 
/var/bootstrap.php.cache 
/bin/* 
!bin/console 
!bin/symfony_requirements 
/vendor/ 
# Assets and user uploads 
/web/bundles/ 
/web/uploads/ 
# PHPUnit 
/app/phpunit.xml 
/phpunit.xml 
# Build data 
/build/ 
# Composer PHAR 
+0

你有你''composer.lock''文件地点?你有没有尝试''作曲家更新''而不是? – 2015-02-11 09:53:37

+0

是的,我有一个composer.lock和作曲家更新只是做了相同的结果 – Eagle1 2015-02-11 10:10:42

+0

,你确定你在composer.json中注册了FOSUserBundle吗?也许''缓存:清除''将有助于 – 2015-02-11 10:12:33

回答

2

这听起来像你vendor/目录是处于不一致的状态。

一般来说,作曲家recommends not versioning vendor/。您的composer.json and composer.lock files should both be committed和Composer可以从这些文件构建vendor/

我建议再次删除vendor/并运行composer install以从头重建它。假设composer.jsoncomposer.lock是正确的,这应该让你回到工作状态。

然后确保你忽略了vendor/,例如,用线如

vendor/ 

.gitignore,并删除可能已被无意中提交到存储库的任何供应商的文件:

git rm --cached -r vendor 
+0

的确是这个问题。它看起来即使是一个空文件夹也足以让作曲家将依赖关系视为正在安装 – Eagle1 2015-02-11 23:10:07

+0

就像一个魅力一样工作 - 谢谢。 – 2016-10-12 19:40:43