【发布时间】:2015-06-18 14:00:54
【问题描述】:
我已将一个 Rails 3.0 应用程序迁移到 Heroku 上的 3.1。它在 cedar 堆栈上运行,一切都很好,只是应用程序的 javascript 无法运行。 application.js 文件已编译并且看起来与它应有的一样。可以通过访问 myapp.com/assets/application.js 来访问它。它只是没有运行!
如果我在本地运行应用程序,javascript 可以工作,所以我怀疑一定有一些我遗漏的简单配置问题。这是我的 production.rb 文件:
FloridaBirdTrail::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end
编辑
将 production.rb 的内容替换为 development.rb 的内容至少允许我的一些 javascript 运行(gmap3 不工作,出于某种原因)。但是哪些设置会产生影响?
【问题讨论】:
标签: javascript ruby-on-rails-3 heroku ruby-on-rails-3.1