Note that there are some explanatory texts on larger screens.

plurals
  1. POSprockets::EncodingError in javascript files in Ruby on Rails3.2
    primarykey
    data
    text
    <p>I have a <strong>Ruby On Rails(Ruby 1.9; Rails 3.2.13)</strong> application. I am trying to create charts using Highcharts. But i am getting an error on browser as <strong>Sprockets::EncodingError in Product#index</strong><br> <strong>sample/app/assets/javascripts/highcharts.js has a invalid UTF-8 byte sequence</strong> .The code files are as below. I have added the files rails.js, highcharts.js and jquery 1.4.2.min.js inside <strong>assets/javascript</strong> folder.</p> <p><strong>application.html.erb</strong></p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Sample&lt;/title&gt; &lt;%= stylesheet_link_tag "application", :media =&gt; "all" %&gt; &lt;%= javascript_include_tag "jquery-1.4.2.min", "rails", "highcharts" %&gt; &lt;%= csrf_meta_tags %&gt; &lt;/head&gt; &lt;body&gt; &lt;%= yield %&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The <strong>index.html.erb</strong> file is as below.</p> <pre><code> &lt;script type ="text/javascript" charset="UTF-8"&gt; &lt;/script&gt; $(function() { new Highcharts.Chart({ chart:{ renderTo:"products_chart" type: 'column' } title: { text: 'Number of Patents Granted', }, credits: { position: { align: 'left', x: 20 }, href: 'http://www.uspto.gov', text: 'Source: U.S. Patent &amp; Trademark Office' }, xAxis: { categories: [ '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011' ] }, yAxis: { title: { text: 'No. of Patents' } }, plotOptions: { }, series: [{ name: 'UK', data: [ 4351, 4190, 4028, 3895, 3553,4323, 4029, 3834, 4009, 5038, 4924 ] }] }); }); </code></pre> <p>Can anyone help to resolve this error ?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload