jeudi 16 août 2018

RoR 3.2.6: Uncaught ReferenceError: jQuery is not defined

currently I'm working on an older ruby on rails project.

In use:

  • ruby 2.2.10
  • rails 3.2.6
  • jquery-rails 3.1.5
  • bootstrap-sass 2.3.2.2
  • execjs 2.7.0
  • therubyracer 0.12.3

My console prints Uncaught ReferenceError: $ is not defined. Then I tried to define $ = jQuery which printed Uncaught ReferenceError: jQuery is not defined which means that jQuery is not properly included. I also read a lot of other posts about this issue but nothing has fixed mine so far.

application.js (snippet)

    //= require jquery
    //= require jquery_ujs
    //= require bootstrap

application.html.erb (snippet)

    <head>
      <title>Creative Title</title>
      <%= stylesheet_link_tag    "application", :media => "all" %>
      <%= javascript_include_tag "application" %>
      <%= csrf_meta_tags %>
    </head>

There's nothing special in the dev console ... - it's driving me really crazy.
I really appreciate your help.

Aucun commentaire:

Enregistrer un commentaire