我第一次使用Ember JS。它是在Rails项目中使用的,我使用的是ember-rails gem。我遵循了ember-rails GitHub上的说明。
在bundle install之后,我运行rails g ember:bootstrap来启动程序。然后,我还将以下两行添加到application.js:
//= require ember
App = Ember.Application.create();问题是,当我访问localhost:3000/时,我在控制台中记录了以下JavaScript错误:
Uncaught Error: assertion failed: Ember Handlebars requires Handlebars 1.0.beta.5 or greater :3000/assets/ember.js?body=1:43
Uncaught ReferenceError: DS is not defined :3000/assets/store.js?body=1:1
Uncaught TypeError: Cannot call method 'template' of undefined :3000/assets/templates/application.js?body=1:1
Uncaught TypeError: Cannot call method 'template' of undefined :3000/assets/templates/application.js?body=1:1
Uncaught Error: <HotDoc.ApplicationView:ember138> - Unable to find template "application".我运行的是Rails 3.2.6。
有什么办法可以解决这些问题吗?据我所知,ember-rails包含了Handlebar代码,所以我不需要添加任何其他的gem。
我是不是遗漏了什么?
发布于 2012-10-12 17:25:34
在Ember1.0.pre中,他们已经解绑了把手。您需要自己提供它。看起来ember-rails假设了同样的事情。
编辑
您需要在文件的顶部添加
//= require handlebarshttps://stackoverflow.com/questions/12855723
复制相似问题