ERROR: couldn't find file 'hogan.js' #6

jmwhittaker opened this Issue May 4, 2012 · 11 comments

7 participants


I have these line sin my manifest file:
//= require hogan.js
//= require_tree ./templates

Where am I going wrong? Thx


Hi @jmwhittaker,

The hogan.js file is included in the gem, under vendor/assets/javascripts. Are you including the gem in a bundler group that is not being loaded?


Hey @leshill

I'm having the same issue. I've uploaded my Gemfile to

Any Ideas on how to fix this? The same source works well on a coworkers laptop.

Thanks for your hard work!


Hi @Weluse-Gast,

Do you mind posting the Gemfile instead of the lockfile?

Also, try this:

//= require hogan


Hey @leshill,

thanks for your answer. I tried in my application.js require hogan with

//= require hogan

but nothing changed, the hogan.js could not be found.

Here ist my Gemfile you asking for.


Hi @Weluse-Gast,

Not seeing anything obvious in the Gemfile.

As a workaround, you can copy the hogan.js file into app/assets/javascripts.


I had this same problem (running in 'development'). Restarting the server fixed it.


Hi @leshill,

after puting the hogan.js into app/assets/javascript the application run in development mode. But in testmode the tests can not find the HoganTemplates. Have you any idea, why the tests can not find the templates?


Hi @Weluse-Gast,

That is unexpected. Have you run the server in test mode?


I've also had problems loading Hogan in my test environment

I eventually got around it by creating a separate interface for HoganTemplates and passing it in as a injectable dependancy

class window.MyClass
   constructor: (@template = new HoganTempateBuilder) ->

...and in my spec:

beforeEach ->
  @fake_template = { render: -> "" }
  @render = sinon.stub(@fake_template, 'render', -> '<li>THE MUSTACHE TEMPLATE</li>')
  @loader = new MyClass(@fake_template)

I believe this has to do with the fact the gem was included in group assets... I will close the issue for now, if it still exists please indicate!


Ah yes, I had the same issue until I removed the group :assets around the gem call. Maybe this is only an issue in Rails 4. In any case, the README should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment