简体   繁体   English

Rails 4-应用程序可在本地运行,但不能在Heroku上运行

[英]Rails 4 - App works locally, but not on Heroku

In my app, I'm using the cocoon gem to dynamically add/remove nested form fields. 在我的应用程序中,我正在使用茧形宝石动态添加/删除嵌套表单字段。 The problem I am experiencing is that it works perfectly in my development environment, but when I push to Heroku, that piece of functionality doesn't work. 我遇到的问题是,它在我的开发环境中可以正常工作,但是当我使用Heroku时,该功能无法正常工作。 To clarify what I mean, the link to add a form field simply doesn't do anything. 为了弄清楚我的意思,添加表单字段的链接根本没有任何作用。

<%= link_to_add_association "Add URL", f, :mozs %>

Now, I am making the assumption that since it works locally, that my code is correct and nothing is wrong there. 现在,我假设由于它可以在本地运行,因此我的代码正确无误。 What I would like to know is why might I experience this issue between dev and production? 我想知道的是为什么我会在开发人员和生产人员之间遇到这个问题? What could be different between the two environments that might cause this? 导致这种情况的两个环境之间可能有何不同?

I know Heroku uses the rails_12factor gem, which I have set to use in production. 我知道Heroku使用rails_12factor宝石,我已将其用于生产。 Could this be a potential conflict with the cocoon gem that I am using? 这可能与我正在使用的茧宝石潜在冲突吗?

(Note: I'm not sure what other useful information I can provide. Please let me know if there is anything else that would be useful for me to include.) (注意:我不确定我还能提供什么其他有用的信息。如果还有其他有用的信息,请告诉我。)

Don't forget rake assets:precompile . 不要忘记rake assets:precompile In the case of rake aborting from invalid css, check the bootstrap_and_overrides.css for any added less code. 如果rake因无效的CSS异常中止,请检查bootstrap_and_overrides.css以了解是否添加了更少的代码。 I've noticed that generating this from the twitter-bootstrap-rails gem has in the past done this to me. 我已经注意到,过去通过twitter-bootstrap-rails gem生成了此文件。

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

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