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

Closed
chadhietala opened this Issue Mar 9, 2013 · 7 comments

Projects

None yet

3 participants

Member

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.

Member

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

Member

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

Member

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
Member

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'
Member

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

Member

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.

Member

It does notify you when you run the generator and every time you start the app, but more documentation never hurt anybody :)

Bradley Priest
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Saturday, 9 March, 2013 at 10:41 AM, Chad Hietala wrote:

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.


Reply to this email directly or view it on GitHub (#151 (comment)).

@MiguelMadero MiguelMadero added a commit to MiguelMadero/ember-rails that referenced this issue Oct 21, 2013
@MiguelMadero 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