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

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

报告相同问题?