1

I'm trying to use Emblem.js to render Ember templates in a Rails app. Here is a part of my Gemfile:

gem 'ember-rails'
gem 'ember-source', '~> 1.9.0'
gem 'emblem-rails'
gem 'emblem-source', github: 'machty/emblem.js'

This is according to the installation instructions of emblem-rails gem: https://github.com/alexspeller/emblem-rails

I have a very basic app. This is the layout written in slim:

doctype html
html
  head
    title My App Title
    = stylesheet_link_tag    'application', media: 'all'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  body

I also have a basic Ember-Rails app where I have my application template written with emblem /app/assets/javascripts/templates/application.emblem:

h1 Hello World

But I get the following error (even after restarting my puma server):

ArgumentError at /
wrong number of arguments (1 for 2)
  (in /Users/htaidirt/Code/MyApp/app/assets/javascripts/templates/application.emblem)

with a highlight to the layout at = javascript_include_tag 'application' line: https://www.dropbox.com/s/un8ixkpgvn81txi/Screen%20Shot%202015-07-29%20at%2019.00.46.png?dl=0?dl=1

Do you have any idea how can I fix that? Thanks.

Hassen
  • 6,966
  • 13
  • 45
  • 65

1 Answers1

3

Had the same issue. Solved with

gem 'sprockets', '2.11.0'

gem 'ember-rails', '~> 0.19.0'

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

gem 'ember-emblem-template'

gem 'emblem-source', '~> 0.4'

Alexandr
  • 170
  • 2
  • 8
  • Thanks @Alexandr, it works. But now I'm getting 4 warnings (deprecations) in my console: `DEPRECATION: Using 'Ember.HTMLBars.makeBoundHelper' is deprecated`, `DEPRECATION: Using Ember.HTMLBars._registerHelper is deprecated`, `DEPRECATION: Using 'Ember.HTMLBars.makeBoundHelper' is deprecated` and `DEPRECATION: Using Ember.HTMLBars._registerHelper is deprecated` – Hassen Aug 10 '15 at 14:18
  • thanks for pointing `gem 'ember-emblem-template'`, it helps without downgrading sprockets – sampi Dec 23 '15 at 09:51