Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Asset Pipeline: cannot include single file from lib? #2767

Closed
carhartl opened this Issue · 3 comments

2 participants

@carhartl

Using Rails 3.1.0, I have:

# Rails.application.config.assets.paths

["/Users/carhartl/Workspace/tweek.tv/app/assets/images", "/Users/carhartl/Workspace/tweek.tv/app/assets/javascripts", "/Users/carhartl/Workspace/tweek.tv/app/assets/stylesheets", "/Users/carhartl/Workspace/tweek.tv/app/assets/templates", "/Users/carhartl/Workspace/tweek.tv/lib/assets/javascripts", "/Users/carhartl/Workspace/tweek.tv/vendor/assets/javascripts"]

In lib/assets/javascripts there is a file named simulate_touch.js which I am trying to require from app/assets/javascripts/application.js:

//= require_tree .
//= require simulate_touch

This gives me such error:

couldn't find file 'simulate_touch'
  (in /Users/carhartl/Workspace/tweek.tv/app/assets/javascripts/application.js:16)

Resorting to

//= require_tree .
//= require_tree ./../../../lib/assets/javascripts

works but doesn't seem to be the way it's meant to be. Anyway, is my former usage correct or not? The Rails guide on asset pipeline seems to suggest it is...

@ansman

Works for me, same scenario (I have my require before require_tree though)

@carhartl

Strange. I think I've tested tried requiring from lib without anything else, but let me double check.

@carhartl

I was probably using an outdated sprockets version, don't know, it works now...

@carhartl carhartl closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.