dpchen2004 2016-12-23 10:52
浏览 66
已采纳

Laravel生产:文件“/home/forge/default/storage/app/geoip.mmdb”不存在或不可读

I have the following error when moving my site to production.

The file "/home/forge/default/storage/app/geoip.mmdb" does not exist or is not readable. (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php) (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php) (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php)

It is related with this package: Torann/laravel-geoip

The default laravel .gitignore file ignores the storage folder and therefore the file is missing in production:

/vendor
/node_modules
/public/storage
Homestead.yaml
Homestead.json
.env

My question is: Should I remove /public/storage from .gitignore? Is it a good practice to include this file in my project? Is there another way to make this package work?

  • 写回答

1条回答 默认 最新

  • doushi5117 2016-12-24 09:55
    关注

    From my understanding after skimming the documentation, you should be able to just run php artisan geoip:update and it will re-create the database for you. No need to keep it in your git repo.

    Optimization Tip: When using the database option I don't like having the downloaded database in my git repository, so I have my deploy system run the geoip:update during the build process before it's deployed to the servers.

    http://lyften.com/projects/laravel-geoip/doc/services.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退