Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku can't find jquery.ui when using jquery-ui-rails gem in production

I'm using the jquery-ui-rails gem. It works fine on local host, but when I push to heroku it gives heroku logs shows this:

2012-04-11T02:28:59+00:00 app[web.1]: ActionView::Template::Error (couldn't find file 'jquery.ui.slider'
2012-04-11T02:28:59+00:00 app[web.1]:   (in /app/app/assets/stylesheets/application.css:12)):

My production config file:

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.digest = true

Some questions online say to change config.assets.compile to false, but when I do that I get a application.css not precompiled error.

like image 840
Rafi Avatar asked Apr 11 '12 02:04

Rafi


2 Answers

Taking the line gem jquery-ui-rails out of the assets group in the Gemfile seems to help. Similar problem/fix for the twitter bootstrap gem. :)

like image 181
Rafi Avatar answered Sep 24 '22 21:09

Rafi


I had a similar, though not identical, problem. In my case, drag and drop methods worked locally, but Heroku complained that it couldn't find jquery-ui.

What solved it for me was this:

  1. In the Gemfile, added

    gem 'jquery-ui-rails'

  2. In application.js, added

    //= require jquery.ui.all

  3. In application.css, added

    *= require jquery.ui.all

Finally, of course, git commit -a -m "added jquery ui statements", followed by git push heroku master.

like image 31
Norm Avatar answered Sep 22 '22 21:09

Norm