0

I'm using rails 3.2, but I'm compiling my coffee files with CodeKit.

I still want my coffee files to live inside 'assets', but each time I restart rails, it finds them in there and tries to compile them itself.

My files live in /assets/cafe/myscript.coffee, and codekit compiles them into /assets/javascripts/myscript.js

The coffee-rails gem is already commented out in my gemfile (when rails tries to (re) compile it it gives "throw Error("LoadError: no such file to load -- coffee_script)" - though I really dont want it to even try compiling.

Setting "config.assets.compile = false" in application.rb results in "application.js isn't precompiled"

2
  • can you see where that LoadError is thrown from? It looks like it is still trying to run the coffee-rails gem. can you verify that it is not in you Gemfile.lock - some other gems, like RailsAdmin, depend on it and will cause it to be installed and used. Commented Sep 27, 2012 at 6:34
  • Even though it's not loaded, it's still finding coffeescripts in /assets and so trying to compile them. There doesn't seem to be any way to turn this off, which I find surprising. Commented Sep 28, 2012 at 16:33

2 Answers 2

1

you should probably just configure your sprockets manifest to not require the whole tree.

edit app/assets/javascripts/application.js

typically it looks like this:

//= require jquery
//= require jquery_ujs
//= require_tree .

change that to

//= require jquery
//= require jquery_ujs
//= require myscript
Sign up to request clarification or add additional context in comments.

1 Comment

The coffeescripts are actually in ../coffee though, so it shouldn't be this manifest that's causing them to be compiled?
0

An (inferior) workaround is to put my coffeescripts inside "App" rather than "assets" (so one more branch up the tree.)

This sucks because it's not where they should go, but at least it does put it outside rails' stalker-tendencies to find coffeescript files anywhere in assets and try to compile them.

1 Comment

creating folders under /app makes good sense for many things. I guess we just have to live with the /app/assets folder being the domain of the asset pipeline.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.