I'm trying to deploy my app to Heroku. Heroku did not load my js and css files
I ran RAILS_ENV=production bundle exec rake assets:precompile
and it still was not working.
then I ran
heroku rake assets:precompile
I get this error in Heroku logs:
Error compiling asset application.css:
Sprockets::FileNotFound: couldn't find file 'jquery.ui.datepicker'
(in /app/app/assets/stylesheets/application.css.scss:13)
Served asset /application-989f5e5266d9b066eb316183d7db5c77.css - 500 Internal Server Error
Error compiling asset application.js:
Sprockets::FileNotFound: couldn't find file 'jquery.ui.datepicker'
(in /app/app/assets/javascripts/application.js:16)
Served asset /application-d81c946c6f47242e5e97de9bca4938be.js - 500 Internal Server Error
config production.rb:
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.assets.compress = true
config.assets.compile = true
config.assets.initialize_on_precompile = false
config.assets.digest = true
IN ASSETS application.css.scss
*= require_self
*= require bootstrap_and_overrides
*= require jquery.ui.datepicker
*= require bootstrap-timepicker
*= require jquery.fileupload-ui
*= require_tree .
*/
application.js
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require jquery.ui.datepicker
//= require bootstrap-timepicker
//= require jquery-fileupload/basic
//= require jquery-fileupload/vendor/tmpl
//= require_tree .
Any idea how to fix this? thanks in advance for all your help.
I believe the issue has to do with the assets not being precompiled.
In your terminal, if you run:
$ >>> rake assets:precompile
And then do your add and commit:
$ >>> git add .
$ >>> git commit -m 'Added precompiled assets for Heroku'
Assuming your remote is called "heroku":
$ >>> git push heroku master
It should deploy properly, without having to mess up your app.
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