简体   繁体   English

Rails 4 Heroku - 改变不被推?

[英]Rails 4 Heroku - changes not getting pushed?

I am using Heroku to try to deploy a personal Ruby on Rails project and everything was going great until today. 我正在使用Heroku尝试部署个人Ruby on Rails项目,直到今天一切都很顺利。

I am very very new to Ruby on Rails and Heroku so please bare that in mind. 我对Ruby on Rails和Heroku非常新,所以请记住这一点。 I am not sure what is causing my issue and therefore not sure what code or information is best to supply so please ask me what you think you need to know to help resolve the issue and I will provide it. 我不确定是什么原因导致我的问题,因此不确定哪些代码或信息最好提供,所以请问我您认为需要知道什么来帮助解决问题,我会提供。

My Ruby on Rails app worked fine both locally and on Heroku until I followed the information here to try and serve static images from Amazons S3 bucket. 我的Ruby on Rails应用程序在本地和Heroku上运行良好,直到我按照这里的信息尝试从Amazons S3存储桶提供静态图像。 Note I only went as far as the static assets section. 注意我只去了静态资产部分。

This appeared to stop my Ruby on Rails application from recognising changes in my code. 这似乎阻止了我的Ruby on Rails应用程序识别代码中的更改。 So I would make a change to a HTML file in my editor but the server was serving up the older version of the HTML file, even restarting the server didn't fix this. 所以我会在我的编辑器中对HTML文件进行更改,但服务器正在提供旧版本的HTML文件,即使重新启动服务器也无法修复此问题。

I have been searching the web for hours trying to figure out what has gone wrong. 我一直在网上搜索几个小时试图弄清楚出了什么问题。

I deleted everything under public assets and I ran the precompile command: 我删除了公共资产下的所有内容,并运行了预编译命令:

rake assets:precompile rake资产:预编译

And this seems to have improved things locally, when I edit a HTML file the changes are reflected on localhost. 这似乎在本地有所改进,当我编辑HTML文件时,更改会反映在localhost上。 However when I push to Heroku and go to my application hosted on Heroku it still shows the older HTML file no matter how many changes I make and pushes I do to Heroku. 然而,当我推送到Heroku并转到我在Heroku上托管的应用程序时,无论我做了多少更改,我仍然会显示较旧的HTML文件,并将其推送到Heroku。

The HTML files that are not updating are located here: 未更新的HTML文件位于:

app/assets/templates 应用程序/资产/模板

I'm not sure what I may have changed that has caused the HTML files not to get updated on Heroku?? 我不确定我可能已经改变了什么导致HTML文件无法在Heroku上更新? What should I look at and try? 我该看什么,试试看? What other information would be useful in helping track down the issue? 还有哪些其他信息可以帮助追踪问题?

The answer marked as correct in this StackOverflow question worked for me - Updated CSS Stylesheet not loaded following deployment to Heroku? 在这个StackOverflow问题中标记为正确的答案对我有用 - 更新的CSS样式表在部署到Heroku后未加载? - It looks like I accidently added assets precompiled file in my git repo somewhere along my development and that caused the issue. - 看起来我在我的开发中的某个地方意外地在我的git repo中添加了资产预编译文件,这导致了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM