无法在生产模式下访问config.handlebars

时间:2013-05-23 04:54:10

标签: ruby-on-rails-3 config handlebars.js ember-rails

我有一个现有的rails应用程序,并且我添加了一个余端前端。我无法将新版本(首次包括Ember)部署到Heroku。

问题是我无法在生产模式下运行rake任务。

当我尝试在heroku上运行db:migrate时,我发现了这一点。我收到以下错误:

rake aborted!
undefined method `handlebars' for #<Rails::Application::Configuration:0x00000004f0de90>/app/.bundle/gems/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configuration.rb:85:in `method_missing'
/app/config/application.rb:60:in `<class:Application>'

如果我尝试在生产模式下本地运行任何任务,我会得到同样的错误,例如:

RAILS_ENV=production rake -T

违规行,来自config / application.rb:

config.handlebars.templates_root = 'ember/templates'

出于各种原因,我不得不将ember模板移到一个文件级别。它需要留在那里。在开发模式下一切正常。

知道如何解决这个问题吗?

尝试升级ember-rails gem。这没有用。 (我使用的是0.12.0)

1 个答案:

答案 0 :(得分:2)

技巧是将ember-rails gem从资产组中移出