Holger Sindbaek
Holger Sindbaek

Reputation: 2344

Rails 3.1 Production - Javascript is missing .js endings on deployment

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.

Upvotes: 3

Views: 391

Answers (1)

Ed Jones
Ed Jones

Reputation: 653

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

Upvotes: 1

Related Questions