2015-02-11 82 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