0

i'm importing someone's python project into rails and having some trouble getting galleria.js gallery plugin to work. everything seems to be ok locally but when I deploy to heroku the site won't load at all, ie, 'We're sorry, but something went wrong.' the plugin is working correctly locally.

we will start with the galleria load tag, in application.html.erb

Galleria.loadTheme('<%= javascript_path('galleria.cinekine.js') %>');

my js directory looks like

javascripts/application.js`
javascripts/app.js.coffee`
javascripts/galleria.cinekine.js
javascripts/galleria.js

my .scss look like

*
*= require_self
*/
@import 'bourbon';
@import 'meyer';
@import 'sfm';
@import 'apps';
@import 'galleria.cinekine';

i have application.rb configured

config.assets.enabled = true

i'm relatively certain heroku is having trouble precompiling the galleria.cinekine.js file as the relevant output of heroku logs is

    eb.1]:   Rendered layouts/_footer.html.haml (1.5ms)
2012-10-02T04:36:05+00:00 app[web.1]: Completed 500 Internal Server Error in 106ms
2012-10-02T04:36:05+00:00 app[web.1]: 
2012-10-02T04:36:05+00:00 app[web.1]:   app/views/layouts/application.html.erb:18:in `_app_views_layouts_application_html_erb___1858155475977362126_43698200'
2012-10-02T04:36:05+00:00 app[web.1]: ActionView::Template::Error (galleria.cinekine.js isn't precompiled):
2012-10-02T04:36:05+00:00 app[web.1]: 
2012-10-02T04:36:05+00:00 app[web.1]:     21:   autoplay: 5000,
2012-10-02T04:36:05+00:00 app[web.1]:     15: <%= yield %>
2012-10-02T04:36:05+00:00 app[web.1]:     16: <%= render 'layouts/footer' %>

all of which is pretty interesting as heroku is telling me the precompile is ok in the console when I'm pushing it.

Thoughts? As alwasy, StackFoo much appreciated.

contents of application.js

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require galleria
John
  • 1,246
  • 15
  • 34

1 Answers1

1

All of your JS is getting precompiled into one file, presumably application.js, and therefore you can't include the non-precompiled version of a JS file on your page, unless you add this to config/environments/production.rb:

config.assets.precompile += %w( galleria.cinekine.js )
bricker
  • 8,911
  • 2
  • 44
  • 54
  • the site is deploying but doesn't seem to be loading the plugin. http://sfmixology.herokuapp.com/ thoughts? – John Oct 02 '12 at 05:08
  • Are you including the `galleria` JS file in your `application.js` manifest file? – bricker Oct 02 '12 at 05:28
  • wouldn't the `//= require_tree .` in `application.js` cover that? i added `//= require galleria` but it isn't making a difference. – John Oct 02 '12 at 06:00
  • application.js is added to the main article, you aren't referring to manifest.yml, which i don't have cause i'm not precompiling before deployment (correct?) – John Oct 02 '12 at 06:34