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 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号