2014-07-06 7 views
0

laravel 4 설치를 위해 마이그레이션을 만들 때 다음 오류가 발생합니다. 파일이 생성되었지만 다음 오류가 출력됩니다.Laravel 4 Migration Error

Created Migration: 2014_07_06_073213_create-users-table 
Generating optimized class loader 
Compiling common classes 
{"error": 
{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'ClassPreloader\\Command\\PreCompileCommand' not found","file":"\/home\/name123\/domain.com\/laravel\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/OptimizeCommand.php","line":113}}[warehouse] 

$ php artisan migrate:make create-users-table 

동일한 문제가있는 다른 사용자가없는 것 같습니다. 내가 사전에 마이그레이션을

{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to a member function increments() on a non-object","file":"\/home\/dandel26\/danieldelcore.com\/laravel\/app\/database\/migrations\/2014_06_29_092641_create_users_table.php","line":15}} 

감사를 저지 할 때

또한이 오류가.

+0

을 때때로 당신은 작곡가의 너무 이전 버전 (의 PSR-4시를 지원하지 않는 하나를 사용하는 자동로드 - 속된 오류를 얻을 수 있습니다 귀하의 의존성은 그것에 의존합니다.) 터미널에서 'composer selfupdate'를 시도해보고 migrate : make 명령의 오류를 돕는 지 확인하십시오. 실패하면,'vendor' 디렉토리를 완전히 제거하고'composer install'을 실행하여 모든 의존성을 새로 설치하십시오. – alexrussell

+0

고마운 친구, 그 길을가는 것처럼 보입니다. –

답변

0

이전 중이라면 기능이 향상되었습니다. 이 함수에는 다음과 같은 것이 있습니다 :

Schema::create('users', function (Blueprint $table) { 
    $table->increments('id'); 
}); 

변수 $ table을 사용하여 콜백을 정의하지 않은 것 같습니다. Blueprint $table을 추가하면 제대로 작동합니다. 이 경우

오른쪽 네임 스페이스를 가져와야 :

use Illuminate\Database\Schema\Blueprint; 
use Illuminate\Database\Migrations\Migration;