2015-12-01 126 views
17

是新來的Symfony和上個月我不斷地從終端Symfony的3.0安裝

# Linux, Mac OS X 
$ symfony new my_project_name 

安裝在Ubuntu上使用以下命令新的symfony項目,它是完美的工作,直到今天,但比剛纔檢查新版本釋放,但現在它開始給我下面的錯誤

Downloading Symfony... 

    4.93 MB/4.93 MB ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100% 

Preparing project... 

PHP Warning: require(/var/www/projectname/app/SymfonyRequirements.php): failed to open stream: No such file or directory in phar:///usr/local/bin/symfony/src/Symfony/Installer/DownloadCommand.php on line 265 
PHP Stack trace: 
PHP 1. {main}() /usr/local/bin/symfony:0 
PHP 2. require() /usr/local/bin/symfony:10 
PHP 3. Symfony\Component\Console\Application->run() phar:///usr/local/bin/symfony/symfony:35 
PHP 4. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:126 
PHP 5. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:195 
PHP 6. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:878 
PHP 7. Symfony\Installer\NewCommand->execute() phar:///usr/local/bin/symfony/vendor/symfony/console/Command/Command.php:259 
PHP 8. Symfony\Installer\DownloadCommand->checkSymfonyRequirements() phar:///usr/local/bin/symfony/src/Symfony/Installer/NewCommand.php:65 
PHP Fatal error: require(): Failed opening required '/var/www/projectname/app/SymfonyRequirements.php' (include_path='.:/usr/share/php:/usr/share/pear') in phar:///usr/local/bin/symfony/src/Symfony/Installer/DownloadCommand.php on line 265 
PHP Stack trace: 
PHP 1. {main}() /usr/local/bin/symfony:0 
PHP 2. require() /usr/local/bin/symfony:10 
PHP 3. Symfony\Component\Console\Application->run() phar:///usr/local/bin/symfony/symfony:35 
PHP 4. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:126 
PHP 5. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:195 
PHP 6. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:878 
PHP 7. Symfony\Installer\NewCommand->execute() phar:///usr/local/bin/symfony/vendor/symfony/console/Command/Command.php:259 
PHP 8. Symfony\Installer\DownloadCommand->checkSymfonyRequirements() phar:///usr/local/bin/symfony/src/Symfony/Installer/NewCommand.php:65 

我連查的位置USR/local/bin目錄/ symfony中的Symfony和它在那裏。

回答

28

這是一個已解決的問題,您需要指定要安裝的版本。如上所述herehere,您需要:

  1. 更新您的安裝

    >symfony self-update 
    

    或使用sudo,這取決於你如何安裝它:

    >sudo symfony self-update 
    
  2. 指定的版本:

    >symfony new my_project_name 3.0 
    

希望這會有所幫助。

UPDATE

隨着對Symfony的安裝程序的bug的正確決議,現在3.0是默認版本。在其他情況下,您可以指定完整版本(包括次要版本和主要版本),如下所示:

>symfony new my_project_name 3.0.0