Javascript Not Running On Heroku With Rails 3.1
Solution 1:
Open your application.rb
file and make sure your Bundler
require statement looks like the following:
Bundler.require *Rails.groups(:assets)
By default it looks like
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line# Bundler.require(:default, :assets, Rails.env)
Solution 2:
Solution 3:
Were you sure to switch Heroku to the Cedar stack? Here are some docs for upgrading
http://devcenter.heroku.com/articles/rails31_heroku_cedar#upgrading_from_previous_rails_31_releases
Solution 4:
I had some Javascript problems (server-side on Heroku, locally everything was fine) that went away when I * moved all my Javascript into a separate file instead of application.js * removed require_tree from application.js and instead called up every javascript I wanted by name * removed bootstrap.js from my app/assets/javascript folder
My guess is that compilation somehow screws things up.
Solution 5:
I hope you did a local pre-compilation of assets before your latest Heroku push (as advised in one of the responses above). Please check if your system is blocking the execution of JavaScripts. For this, open up the console while you are on your Heroku app, and check for exceptions. In case you see exceptions related to JavaScripts being blocked, that could be the issue. In my case, the same happened, and unfortunately, I was not able to do anything about it, as I didn't have admin privileges.
Post a Comment for "Javascript Not Running On Heroku With Rails 3.1"