After I deploy my project on Heroku, I get for the following code in Firebug this error:
ReferenceError: SirTrevor is not defined
<script type="text/javascript" charset="utf-8">
$(function(){
var instances = $('.sir-trevor-area'),
l = instances.length;
while (l>=2) {
instance = $(instances[l]);
new SirTrevor.Editor({ el: instance, blockTypes: ["Video"], defaultType: "Video" });
l--;
};
while (l>=1) {
instance = $(instances[l]);
new SirTrevor.Editor({ el: instance, blockTypes: ["Embedlylink"], defaultType: "Embedlylink" });
l--;
};
while (l>=0) {
instance = $(instances[l]);
new SirTrevor.Editor({ el: instance, blockTypes: ["Heading", "Text", "Image", "Video", "Embedly"], defaultType: "Text" });
l--;
};
});
</script>
Firebug highlights this line "
new SirTrevor.Editor({ el: instance, blockTypes: ["Heading", "Text", "Image", "Video", "Embedly"], defaultType: "Text" });
"
On localhost everything seems fine, no errors. Anyone an idea what the problem could be? Thank you so much for your help! Really appreciated!
UPDATE:
SirTrevor is defined in sir-trevor.js which is successfully loaded via the Rails asset pipeline in the application.js file.
This is my application.js file:
//= require jquery
//= require jquery_ujs
//= require sir-trevor
//= require underscore.js
//= require eventable.js
//= require twitter/bootstrap
//= require jquery.sidr.js
//= require_tree .
Before push to Heroku I do "rake assets:precompile" . On localhost everything seems fine.
The application.html.erb header:
<!DOCTYPE html>
<html>
<head>
<title>Tt</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" rel="stylesheet">
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
SirTrevoris not defined. Start there. 1) from where isSirTrevorto be defined and; 2) is the resource being successfully loaded? (Use web-browser developer tools to monitor the network requests.)