3

I've just made my Rails app and deployed it to Heroku. A very weird thing happened in the process though. Half of my javascript-files are missing their endings (.js). I have absolutely no idea why this is.I've searched far and wide, but I don't seem to find an answer.

My production-config looks like this:

  # Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = true

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

  # Generate digests for assets URLs
  config.assets.digest = true

  config.assets.precompile << '*.js'

Any suggestions?

Posted this other similar question 1 hour ago (http://stackoverflow.com/questions/9049023/rails-3-1-production-javascript-loads-but-doesnt-execute). Sorry for the spamming.

3
  • What stack are you using on Heroku? What version of rails and ruby are you using? Commented Feb 18, 2012 at 10:59
  • you should use serve_static_assets = false for heroku/production Commented Mar 9, 2012 at 3:54
  • Have you tried running the thin server in production on your own machine to see what happens? Commented Mar 15, 2012 at 2:16

1 Answer 1

1

Does this help? You didn't show where your js files are included. If they have dots in the name, apparently you need to tell Rails. asset:precompile for .js files? rails 3.1

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

1 Comment

I'm sorry, but I asked this question over a month ago. I can't even remember how I made it work. Thank you very much for answering the question though.

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.