Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
$ is not defined error in production environment Rails 5.1.7

jQuery and ujs work fine in the development environment, but are not working in production environment.

This is what my code looks like:

application.html.erb


<html>
  <head>
    <%= csrf_meta_tags %>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <%= stylesheet_link_tag    'application', media: 'all' %>
    <%= javascript_include_tag 'application' %>
  </head>
  <body>
      <%= yield %>
  </body>
</html>

application.js

//= require jquery
//= require jquery_ujs
//= require jquery-ui/widgets/sortable
//= require js-routes
//= require semantic-ui
//= require swiper
//= require cocoon
//= require tree_table
//= require jquery_throttle_debounce
//= require trix
//= require_tree .

window.jQuery = $;
window.$ = $;

Any page that uses the application layout has ujs not working and is getting $ is not defined error for jquery codes in production environment only.

Note: I recently removed turbolinks from the application.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!