1

I'm using ember-rails master and created a ember bootstrap project. Everything is empty and left as it was when creating, yet I'm running into the mentioned type error. when the router is entered. The namespace is known, but the router isn't. Has anybody seen this before?

For the sake of completeness I'll past what is there below:

Basis.ApplicationController = Ember.Controller.extend({

});

Basis.ApplicationRoute = Ember.Route.extend({

});

Basis.js:

//= require ./store
//= require_tree ./models
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router
//= require_tree ./routes
//= require_self

Basis.Router.map(function(match) {

});

Basis.Store = DS.Store.extend({
  revision: 11
});

application.handlebars:

Application

<p>Your content here.</p>

{{outlet}}

application.js

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require handlebars
//= require ember
//= require ember-data
//= require_self
//= require basis
Basis = Ember.Application.create();
//= require_tree .
sly7_7
  • 11,961
  • 3
  • 40
  • 54
Rudi
  • 1,577
  • 3
  • 16
  • 42

2 Answers2

1

Alternatively you can bundle ember-rails from master on github:

gem 'ember-rails', github: 'emberjs/ember-rails'

Then bundle install. Make sure you don't have any locally vendored versions of handlbars, ember.js, or ember-data hanging out.

Right now ember-rails master is at ember.js 1.0.0-pre4.

If you want to track ember.js and ember-data at master, you can also do this to vendor (in a way that doesn't conflict with ember-rails) them:

bundle exec rails g ember:install --head

This will install them at vendor/assets/ember.

mcginniwa
  • 360
  • 3
  • 9
  • thanks, i'll give the ember:install a go next time. It's sometimes a bit obscure as to what is available in which gem. The benefit of downloading the .js libs and putting them in /vendor/assets/javascript is that I know exactly what I have – Rudi Jan 19 '13 at 20:05
0

If you are using the latest from master from Ember-Rails then the problem is that the vendor files for ember are out of date. The Ember.js in Ember-Rails is at v1.0.pre-279-gb1c0b4c, and Ember-Data is at 4. In order to use the current documentation in your code you will need to updated a release of Ember.js and Ember-Data.

You can find a more recent EmberJS file here: EmberJS v1.0.0-pre.2-396-gddb0951 and Ember-Data: Ember-Data v11. Just rename them to match what you have now.

You can see your code with the updated Ember files here: http://jsfiddle.net/seankeating/ZRN23/7/

Sean Keating
  • 1,718
  • 14
  • 28
  • Thanks, now I can continue tonight. I was expecting master to always have a working deliverable. Guess I shouldn't expect that. – Rudi Jan 16 '13 at 15:37
  • Still struggling. If I add 'match('/').to('application');' in the Basis.Router body I get the next error, match is undefined. – Rudi Jan 16 '13 at 21:22
  • Match is no longer a valid syntax for refining routes. You will need something like: App.Router.map(function() { this.route('application', { path: '/'}); }); You can see my example at: https://github.com/seankeating/ember-js-example/blob/master/app/router.js New documentation at: http://emberjs.com/guides/routing/defining-your-routes/ – Sean Keating Jan 16 '13 at 21:27
  • wow, things don't only change, they change super fast. Thanks for your help again. – Rudi Jan 16 '13 at 21:42