Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

deploying to heroku asset pipeline Sprockets::fileNotFound

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.

like image 571
Benamir Avatar asked Oct 25 '12 21:10

Benamir


1 Answers

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.

like image 155
chaseadamsio Avatar answered Sep 18 '22 14:09

chaseadamsio