10

the Rails Guides says:

If there are missing precompiled files in production you will get an Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError exception indicating the name of the missing file(s).

I do execute:

bundle exec rake assets:precompile

however I don't get any error, and my javascript file is missing in the manifest.yml. Also it's not appearing in public/assets, so the problem is only on production.

I have in the application.js

//= require formalize/jquery-formalize

What am I missing?

Thanks.

2
  • In development env, can you access jquery-formalize correct? Commented Apr 19, 2012 at 1:26
  • yes, in development I see it's working Commented Apr 19, 2012 at 5:57

2 Answers 2

17

Actually two things needed to do:

config.assets.precompile += %w( *.js *.css )

as described here, and

config.serve_static_assets = true

for local production testing when using

rail s

of course using

rake assets:precompile

however in my case - without config.assets.precompile this would have no effect since the manifest didn't contain any reference to my javascript file.

HTH.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, you saved me hours. I tried all of the above except ... "config.assets.precompile += %w( *.js *.css )". That did the trick
After 3 hours of similar issues where assets were available in Development, but not on Production... those two lines in production.rb saved me! Now Development and Production behave in the same manner!
5

Try just:

rake assets:precompile

I've had similar issues and that has worked. You can also delete the contents of the /public/assets directory and try running it again.

Comments

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.