【问题标题】:heroku [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Faker\Factory' not foundheroku [Symfony\Component\Debug\Exception\FatalThrowableError] 类 'Faker\Factory' 未找到
【发布时间】:2021-08-30 14:14:19
【问题描述】:

我在使用 heroku 时遇到问题:“heroku run php artisan db:seed”

 $ heroku run php artisan db:seed
 Running php artisan db:seed on jaquenews... starting, run.7385 (Free)
 Running php artisan db:seed on jaquenews... connecting, run.7385 (Free)
 Running php artisan db:seed on jaquenews... up, run.7385 (Free)
 **************************************
 *     Application In Production!     *
 **************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes
 yes

 Seeding: UsersTableSeeder

 [Symfony\Component\Debug\Exception\FatalThrowableError]
 Class 'Faker\Factory' not found

【问题讨论】:

  • 我尝试将 faker on require 放入 composer.json 但仍然出错
  • 你能告诉我们UsersTableSeeder的内容吗?

标签: heroku laravel-5 faker


【解决方案1】:

当您运行此命令时,它可能会告诉您未找到“Faker\Factory”类。发生这种情况是因为需要 faker 作为开发依赖项。要解决这个问题,只需打开您的 composer.json 文件并将 faker 从 require-dev 移动到 require。 然后运行 ​​composer update。

来自https://dev.to/doougui/deploying-your-laravel-mysql-application-on-heroku-5d92

【讨论】:

    猜你喜欢
    • 2020-01-21
    • 1970-01-01
    • 1970-01-01
    • 2019-08-02
    • 2020-05-15
    • 2017-08-21
    • 2019-07-18
    • 1970-01-01
    • 2018-08-18
    相关资源
    最近更新 更多