【发布时间】:2022-02-23 13:10:45
【问题描述】:
我创建了一个直接的 laravel 项目,只是样板文件。当我使用风帆指南 (https://laravel.com/docs/9.x/sail#installation) 时,我运行 composer require laravel/sail --dev 并且运行良好,但是当我执行 php artisansail:install 时出现此错误:
ErrorException
file_get_contents(/home/michaelb/Desktop/scouting/.env): Failed to open stream: No such file or directory
at vendor/laravel/sail/src/Console/InstallCommand.php:125
121▕ * @return void
122▕ */
123▕ protected function replaceEnvVariables(array $services)
124▕ {
➜ 125▕ $environment = file_get_contents($this->laravel->basePath('.env'));
126▕
127▕ if (in_array('pgsql', $services)) {
128▕ $environment = str_replace('DB_CONNECTION=mysql', "DB_CONNECTION=pgsql", $environment);
129▕ $environment = str_replace('DB_HOST=127.0.0.1', "DB_HOST=pgsql", $environment);
+15 vendor frames
16 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
这是在选择我想要 pgsql 数据库之后。我该怎么做才能解决这个问题?
【问题讨论】: