Since you have ember-rails
in your Gemfile
you're probably getting the version of Ember that it provides, not the one that lives in app/assets/javascripts/lib/development
. You can load /assets/ember.js
in your browser to verify. If you want to make sure you get your custom version you should use this in application.js
//= require lib/development/ember
Alternatively to be extra sure, you could remove ember from application.js
completely and include the latest canary ember directly in your layout.
<script type='text/javascript' src="http://builds.emberjs.com/canary/ember.js"></script>
[UPDATE] : OK, the problem is that you're including ember.js multiple times (and possibly with multiple versions). I missed it when you first posted your bit list of script tags, but if you look at that closely you'll see that Ember and Ember Data are included at the top (lines 4 and 5 of the scripts), and then they're each included two mored times at the bottom.
...
<script src="/assets/ember.js?body=1"></script>
<script src="/assets/ember-data.js?body=1"></script>
...
<script src="/assets/lib/development/ember-data.js?body=1"></script>
<script src="/assets/lib/development/ember.js?body=1"></script>
<script src="/assets/lib/production/ember-data.js?body=1"></script>
<script src="/assets/lib/production/ember.js?body=1"></script>
...
My guess is that application.js
is requiring ember once on purpose with
//= require ember
And then it's getting picked up again with a require_tree
//= require_tree .
Usually you want to store external libraries (code that you do not personally maintain) in the vendor
directory of your app. This would allow to still use require_tree
to get all of your own javascript included in one shot. In my project that uses ember-rails
my structure looks like this:
app
assets
javascripts
# All my own stuff goes here
vendor
assets
ember
development
ember.js
ember-data.js
production
ember.js
ember-data.js
ember-rails
will find the versions in vendor
if you just use require ember
in application.js
. You'll want to make sure that you set config.ember.variant
in each of your config/environments/*.rb
files. For instance in config/environments/development.rb
you'll need to add this :
config.ember.variant = :development