Ruby on rails Ember rails在heroku上不工作

Ruby on rails Ember rails在heroku上不工作,ruby-on-rails,heroku,ember.js,ember-data,ember-rails,Ruby On Rails,Heroku,Ember.js,Ember Data,Ember Rails,我使用Rails API返回JSON,然后在Ember应用程序的实体模型中使用JSON。 虽然这在localhost上运行良好,但当我将应用程序部署到Heroku时,它不起作用;它在控制台上显示此错误: "Error while loading route: entities" "e.addArrayObserver is not a function" "P<._setupArrangedContent@http://myappadress.herokuapp.com/assets/a

我使用Rails API返回JSON,然后在Ember应用程序的
实体
模型中使用JSON。
虽然这在
localhost
上运行良好,但当我将应用程序部署到Heroku时,它不起作用;它在控制台上显示此错误:

"Error while loading route: entities" "e.addArrayObserver is not a function" 
"P<._setupArrangedContent@http://myappadress.herokuapp.com/assets/application-ac292d8e3f9c271670b08f58e5920cf3.js:14
这是我的“实体”路线

    App.EntitiesRoute = Ember.Route.extend
       model: (params)->
       App.Entity.get_by_addr(params.addr)
这是我在Rails中的application.js文件

    //= require jquery
    //= require jquery_ujs
    //= require foundation
    //= require ember_application
    //= require_tree .
这是我的production.rb文件

    Rails.application.configure do

        # Disable Rails's static asset server (Apache or nginx will already do this).
        config.serve_static_assets = false

        config.assets.js_compressor = :uglifier
        # config.assets.css_compressor = :sass

        # Do not fallback to assets pipeline if a precompiled asset is missed.
        config.assets.compile = false

        # Generate digests for assets URLs.
        config.assets.digest = true

        # Version of your assets, change this if you want to expire all your assets.
        config.assets.version = '1.0'

        # Specifies the header that your server uses for sending files.
        # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
        # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

        # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
        # config.assets.precompile += %w( search.js )
        config.ember.variant = :production

这是CoffeeScript的正确格式吗?我认为在你的
之后,你需要再缩进一级

App.Entity.reopenClass get_by_addr: (addr) ->
  $.getJSON("api/v1/entities?addr=" + addr ).then (response) ->
  entities = []
  a = App.Entity.create response

第二件事,有一个问题是
addr
是如何传入的:如果它是从内存中指向
链接,参数不会自动传入
id

之外,你能分享你的余烬路线和控制器吗?你能从Rails应用程序中显示你的
application.js
文件吗?干杯。谢谢@AlexLynham,我已经编辑了我的问题对不起,我已经编辑了这个问题,我有正确的咖啡脚本缩进,并且认为在本地工作正常,我用你有控制器代码吗?根据我记忆中的情况,我遇到了一个类似的问题,模型将无效或空数组转发给
ArrayController
——不知这是否是某种方式的问题。也是
/=require-ember_应用程序
application.js
的第14行吗?我没有任何控制器代码,但现在我删除了“实体”模型,并直接从类似模型的模型中访问它:function(params){return$.getJSON('/api/v1/entities.json?addr='+params.addr);},现在这一切正常了。。。我认为我的模型或ember数据出现了一些问题(因为我使用的是ember rails gem,因此本地和heroku上都有不同的ember数据副本),这听起来可能与加载路径有关。我必须承认,我不明白为什么一眼就看出它可能无法从这个代码中工作。也许余烬/余烬数据版本的变更日志将提供一个线索。
App.Entity.reopenClass get_by_addr: (addr) ->
  $.getJSON("api/v1/entities?addr=" + addr ).then (response) ->
  entities = []
  a = App.Entity.create response