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 Qt 不小心删除了自带的类,该怎么办
    • ¥15 我需要在PC端 开两个抖店工作台客户端.(语言-java)
    • ¥15 有没有哪位厉害的人可以用C#可视化呀
    • ¥15 可以帮我看看代码哪里错了吗
    • ¥15 设计一个成绩管理系统
    • ¥15 PCL注册的选点等函数如何取消注册
    • ¥15 问一下各位,为什么我用蓝牙直接发送模拟输入的数据,接收端显示乱码呢,米思齐软件上usb串口显示正常的字符串呢?
    • ¥15 Python爬虫程序
    • ¥15 crypto 这种的应该怎么找flag?
    • ¥15 代码已写好,求帮我指出错误,有偿!