当通过git将图像上传到heroku时,图像从Web服务器发送时会损坏。我一直试图通过再次登录g rm --cached images/contact-me.png
然后g add images/contact-me.png
来解决问题,然后再推送。Heroku图像损坏
另外;
[email protected]:~/labs/exposeit-site$ sha1sum images/contact-me.png
2d319cd64e94afe7cdd169347653670a1dd82581 images/contact-me.png
[email protected]:~/labs/exposeit-site$ wget http://exposeit.herokuapp.com/images/contact-me.png
--2012-08-16 16:50:35-- http://exposeit.herokuapp.com/images/contact-me.png
Resolving exposeit.herokuapp.com (exposeit.herokuapp.com)... 50.19.121.246, 174.129.192.155, 184.73.155.93, ...
Connecting to exposeit.herokuapp.com (exposeit.herokuapp.com)|50.19.121.246|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1230115 (1.2M) [image/png]
Saving to: `contact-me.png'
100%[=================================================================================>] 1,230,115 963K/s in 1.2s
2012-08-16 16:50:36 (963 KB/s) - `contact-me.png' saved [1230115/1230115]
[email protected]:~/labs/exposeit-site$ sha1sum contact-me.png
74d97745d35bb67e5517611b683ed461bd0c1686 contact-me.png
和
[email protected]:~/labs/exposeit-site$ g ls-files | grep contact-me
images/contact-me.png
这是Heroku的一个问题?
更新:
Procfile:
web: bundle exec thin start -R config.ru -e $RACK_ENV -p $PORT
当我要求该文件时,鞋子已被切断。由于我们现在只是测试Heroku(意思是说,我们还没有投入),所以我们现在不在S3上托管它们。此外,这些图像不是静态的,但可以在提交之间进行更改,因为我同时执行编码和图形... – Henrik 2012-08-17 07:31:09
您可以通过在服务器上运行“sha1sum”来测试映像在上载过程中是否损坏https:// devcenter .heroku.com/articles/ssh-access – 2012-08-17 12:59:14
使用'heroku run bash'在bash中映像散列正确。 – Henrik 2012-08-20 15:10:22