Note that there are some explanatory texts on larger screens.

plurals
  1. POSprockets not loading manifest files (jQuery, jQuery_ujs)
    primarykey
    data
    text
    <p>I am having an issue getting sprockets to load the files specified in the manifest section of 'application.js' file. I have tried re-ordering the directives in the 'application.js' file, I have tried upgrading and down-grading ruby/rails but nothing is causing sprockets to load the files in the directives. </p> <p>I added a few other files into the 'assets/javascripts' and 'assets/stylesheets' folders to see if sprockets would load those but none of those are getting loaded either. However, if drop into the console and type 'Sprockets.class' it recognizes the module so it seems that sprockets is indeed being loaded. </p> <p>I am using Ruby 2.0.0/Rails 3.2.8</p> <p>Here is my Gemfile</p> <pre><code>source 'https://rubygems.org' gem 'rails', '3.2.8' # Bundle edge Rails instead: # gem 'rails', :git =&gt; 'git://github.com/rails/rails.git' gem 'sqlite3' gem "rspec-rails", :group =&gt; [:test, :development] group :test do gem "factory_girl_rails" gem "capybara" gem "guard-rspec" gem "debugger" end group :assets do gem 'sass-rails', '~&gt; 3.2.3' gem 'coffee-rails', '~&gt; 3.2.1' gem 'uglifier', '&gt;= 1.0.3' end gem "jquery-rails" </code></pre> <p>And here is my Gemfile.lock with any entry relating to sprockets or jQuery</p> <pre><code>specs: actionpack (3.2.1) sprockets (~&gt; 2.1.2 sprockets (2.1.3) jquery-rails (3.0.4) DEPENDENCIES jquery-rails </code></pre> <p>EDIT 1 -- Application.js</p> <pre><code>// 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 jquery.cookie //= require_tree . $(document).ready(function(){ alert('shit is ready'); }); </code></pre> <p>Then in the chrome console I get 'Uncaught ReferenceError: $ is not defined' </p> <p>When I display my asset paths using 'Rails.application.config.assets.paths' I can see that the jQuery library is indeed in the load path. I have also checked to make sure that the files are actually at the location specified in the path, which they are. </p> <p>I have not gotten any sort of dependency messages when trying to bundle my project but I suspect that that is what is going on. I was have plenty of other projects that use jquery/asset pipeline in Ruby 1.9.2/Rails 3.2.1 and I have not done anything different with my new set up. My understanding is that sprockets and jquery are both things that should just work out of the box so I am especially perplexed.</p> <p>Thanks!!!!</p>
    singulars
    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