I’m newbie to ember.js. I’m trying to integrate ember.js with Rails using ember-rails gem. But when I start server and open my browser console I get following errors:
Uncaught Error: assertion failed: Ember Views require jQuery 1.7 :3000/assets/ember.js?body=1:43
Uncaught TypeError: Cannot call method 'extend' of undefined :3000/assets/ember-data.js?body=1:141
Uncaught ReferenceError: Blog is not defined :3000/assets/store.js?body=1:1
Uncaught ReferenceError: Blog is not defined :3000/assets/controllers/application_controller.js?body=1:1
Uncaught ReferenceError: Blog is not defined :3000/assets/views/application_view.js?body=1:1
Uncaught TypeError: Cannot call method 'template' of undefined :3000/assets/templates/application.js?body=1:1
Uncaught ReferenceError: Blog is not defined :3000/assets/routes/app_router.js?body=1:1
Uncaught ReferenceError: Blog is not defined :3000/assets/blog.js?body=1:10
Uncaught TypeError: Cannot call method 'create' of undefined ember.js:10183
Uncaught ReferenceError: Blog is not defined
How to solve it? Or how to integrate ember.js to rails by manually.
Thank you for advise.
Here’s the issue with ember-rails (https://github.com/emberjs/ember-rails/issues/88)
To force jquery to be 1.7, you can use the version 1.0.19 of the jquery-rails gem. So change your Gemfile to be:
And you’ll be set.
As an alternative, you could follow the suggestion in the GH issue, and
before the ember.js is loaded to override the requirement check for any version of jquery. (I have not tested this).