简体   繁体   中英

ember-rails Ember Handlebars requires Handlebars version 2.0

I am trying to get a simple app runnning based off http://ember.vicramon.com/chapters/all

I haven't even begun my app; all I have done so far is:

  • generate using rails new
  • rails g ember:bootstrap -n App --javascript-engine js
  • rails g ember:install --ember
  • rails g ember:install --ember-data

then set the root route to home, with the application.js.emblem as the ember page. I am getting this error:

 Uncaught Error: Assertion Failed: Ember Handlebars requires Handlebars version 2.0. Please see more details at http://emberjs.com/blog/2014/10/16/handlebars-update.html.

Now, visiting the link in the error, the 'rough' directions are:

  • Update Handlebars version to 2.X.
  • Update template precompiler version to 1.9.0-alpha or later.

Here is my gem file ( I believe this is all thats related to ember:)

# Ember
gem 'ember-rails'
gem 'ember-source', '1.9.0.alpha'
gem 'emblem-rails'

So I believe I have the correct ember-source. Now, how do I update the handlebars version? I tried installing the handlebars-source gem (v2.0.0) but I got this error:

You have requested:
  handlebars-source = 2.0.0

The bundle currently has handlebars-source locked at 1.3.0.
Try running `bundle update handlebars-source`

Of course, following up, I tried the bundle update, and yet I got this error:

Bundler could not find compatible versions for gem "handlebars-source":
  In Gemfile:
    ember-source (= 1.9.0.alpha) ruby depends on
      handlebars-source (~> 1.0) ruby

    handlebars-source (2.0.0)

I suspect that all that needs to happen is for ember-source to depend on handlebars-source 2.0 but I have no idea how to do this.

If not this, then how can I update handlebars for my ember-rails app so that I can use ember?

I think your problem stems from trying to source the alpha version of ember. Try:

gem 'ember-source', '~> 1.9.0'

then run bundle install and rails generate ember:install so that your vendor/assets folder gets the correct version of ember.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM