After deploying a Rails app to Heroku, no javascript functions are working.
The files appear to have been compiled (though its not easy to see in the minified file).
What is a logical process of steps to work out why the javascript is not working (it works fine in production).
Thanks
This problem is associated with asset pipeline. You should compile assets.
To solve it, Turn config.assets.compress to true in config/environments/production.rb,
ie
config.assets.compress = true
Then run RAILS_ENV=production bundle exec rake assets:precompile .
Push the code again.
Sometimes I have issues because of the asset pipeline and my misunderstanding of it. So what I do just to make sure things are being packaged up correctly is just put in a simple alert when the page loads (put it on some random page users can't get to, etc)
alert('some-unique-string')
Push the code up to the server. Then in chrome bring up the page and use the dev tools, goto the "scripts" tab. From there you can search for the string some-unique-string
since your string literal wont be minified. If you don't see that then you know your javascript isn't being included for some reason.
That at least will give you a starting point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With