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

Closed
jmwhittaker opened this Issue May 4, 2012 · 11 comments

7 participants

@jmwhittaker

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

Where am I going wrong? Thx

@leshill
Owner

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?

@Weluse-Gast

Hey @leshill

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

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

Thanks for your hard work!

@leshill
Owner

Hi @Weluse-Gast,

Do you mind posting the Gemfile instead of the lockfile?

Also, try this:

//= require hogan

@Weluse-Gast

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 https://gist.github.com/3877897 you asking for.

@leshill
Owner

Hi @Weluse-Gast,

Not seeing anything obvious in the Gemfile.

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

@chrislambe

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

@Weluse-Gast

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?

@leshill
Owner

Hi @Weluse-Gast,

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

@vladiim

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)
@AlexRiedler
Collaborator

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!

@KonstantinKo

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