I’m using Ember JS for the first time. It’s for use in a Rails project and I’m using the ember-rails gem. I’ve followed the instructions on the ember-rails GitHub.
After bundle install I run rails g ember:bootstrap to kick things off. I then also add the following two lines to application.js:
//= require ember
App = Ember.Application.create();
The issue is that when I visit localhost:3000/, I get the following JavaScript errors logged to the console:
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".
I’m running Rails 3.2.6.
Any ideas how I can resolve these issues? As far as I understand it, ember-rails includes the Handlebars code so I don’t need to add any other gems.
Am I missing something?
In Ember 1.0.pre they’ve unbundled Handlebars. You need to provide it yourself. Looks like ember-rails assumes the same thing.
Edit
You need to add at the top of the file