Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Ember, Handlebars, Ember-Data are not included #151

Closed
chadhietala opened this Issue · 7 comments

3 participants

Chad Hietala Bradley Priest Stefan Penner
Chad Hietala

I ran rails g ember:bootstrap and rails generated the directory structure and Application controller, view, template, route, etc, however it did not install ember, ember-data, and handlebars as the README states. I didn't get an errors on generation but when I went to go look at it in the browser sprokets threw the following error:

Sprockets::FileNotFound in Home#index

Showing /Users/chietala/workspace/rackr/app/views/layouts/application.html.erb where line #6 raised:

couldn't find file 'handlebars'
  (in /Users/chietala/workspace/rackr/app/assets/javascripts/application.js:15)
Extracted source (around line #6):

3: <head>
4:   <title>Rackr</title>
5:   <%= stylesheet_link_tag    "application", :media => "all" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= javascript_include_tag "templates/all" %>
8:   <%= csrf_meta_tags %>
9: </head>

and application js looks like this.

//= require jquery
//= require jquery_ujs
//= require handlebars
//= require ember
//= require ember-data
//= require_self
//= require rackr
Rackr = Ember.Application.create();
//= require_tree .

If this is correct, why was this chosen? Otherwise I think there is a bug here.

Bradley Priest

Ember, Ember-Data and Handlebars should be included inside the gem, have you restarted your development server since installing the ember-rails gem?

Chad Hietala

I installed the ember-rails before I even started the server. I also just reset the Sprockets cache just to make sure.

Bradley Priest

If you check your server log, you are probably getting this error

No ember.js variant was specified in your config environment.
You can set a specific variant in your application config in
order for sprockets to locate ember's assets:

    config.ember.variant = :development

Valid values are :development and :production
Chad Hietala

Unfortunately no. I'm getting the following error in logs.

Completed 500 Internal Server Error in 129ms

ActionView::Template::Error (couldn't find file 'handlebars'
  (in /Users/chietala/workspace/rackr/app/assets/javascripts/application.js:15)):
    3: <head>
    4:   <title>Rackr</title>
    5:   <%= stylesheet_link_tag    "application", :media => "all" %>
    6:   <%= javascript_include_tag "application" %>
    7:   <%= javascript_include_tag "templates/all" %>
    8:   <%= csrf_meta_tags %>
    9: </head>
  app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___4099874314698015678_2153109920'
  app/controllers/home_controller.rb:4:in `index'
Bradley Priest

Sorry, that message will only come up when you first start the server. It also comes up after running rails g ember:bootstrap. To fix your issue you need to add the line config.ember.variant = :development to config/development.rb

Chad Hietala

Gotcha. As the README reads now I thought this was optional or had something to do with overriding the version of ember you want to work with. I'll put a commit in with some additions to the README.

Bradley Priest
Miguel Madero MiguelMadero referenced this issue from a commit in MiguelMadero/ember-rails
Miguel Madero MiguelMadero Update README.md
It didn't work for me until I set it. As mentioned on #151 and #259 it looks like it's needed and the documentation is a bit misleading. Not sure if it's also needed on 3.1
0d60800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.