title: Bootstrap 5 Javascript Functions not Working in Rails 7 app
body: <p>I'm trying to set up my first Rails 7 app and have installed Bootstrap 5 properly (you can see by the CSS) and gotten rid of all the error messages, but the javascript functions (i.e. dropdown menus, offcanvas, etc.) aren't working.</p>
  <p>I have tested it with this code:</p>
  <pre><code>&lt;script&gt;
    $( document ).ready(function() {
      console.log( &quot;document ready!&quot; );
      $( &quot;#TEST&quot; ).click(function() {
        console.log( &quot;clicked!&quot; );
      });
    });
  &lt;/script&gt;
  </code></pre>
  <p>And both console.log statments produce the correct result, leading me to believe js and jquery are working properly and it is something with bootstrap.</p>
  <p>Here's my gemfile:</p>
  <pre><code>source 'https://rubygems.org'
  git_source(:github) { |repo| &quot;https://github.com/#{repo}.git&quot; }
  
  ruby '3.1.0'
  
  # RAILS GENERATED STUFF
  gem 'rails', '~&gt; 7.0.1'
  gem 'pg', '~&gt; 1.1'
  gem 'puma', '~&gt; 5.0'
  gem 'sass-rails', '&gt;= 6'
  # gem 'webpacker', '~&gt; 5.0'
  gem 'jsbundling-rails'
  gem 'jbuilder', '~&gt; 2.7'
  gem 'bootsnap', '&gt;= 1.4.4', require: false
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  
  # OTHER NECESSARY STUFF
  gem 'jquery-rails'
  gem 'jquery-ui-rails'
  gem 'sprockets-rails'
  gem 'bcrypt', '~&gt; 3.1.7'
  gem 'gon'
  
  # ESSENTIALS
  gem 'devise'
  gem 'simple_form'
  gem 'font_awesome5_rails'
  gem 'friendly_id', '~&gt; 5.2.0'
  gem 'tinymce-rails'
  gem 'invisible_captcha'
  gem 'figaro'
  gem 'high_voltage', '~&gt; 3.1'
  gem 'bootstrap', '~&gt; 5.1', '&gt;= 5.1.3'
  
  # FOR IMAGES
  gem 'mini_magick'
  gem 'aws-sdk' , '~&gt; 3'
  gem 'aws-sdk-s3', require: false
  
  group :development, :test do
    gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
    gem 'pry-rails'
    gem 'better_errors'
  end
  
  group :development do
    gem 'web-console', '&gt;= 4.1.0'
    gem 'rack-mini-profiler', '~&gt; 2.0'
    gem 'listen', '~&gt; 3.3'
    gem 'spring'
  end
  
  group :test do
    gem 'capybara', '&gt;= 3.26'
    gem 'selenium-webdriver'
    gem 'webdrivers'
  end
  </code></pre>
  <p>Here's my <code>application.js</code>, which lives in 'javascript/controllers/application.js<code> but somehow also in</code>assets/builds/application.js<code>.  I'm not using webpack, rather rollup installed with </code>$ ./bin/rails javascript:install:rollup`:</p>
  <pre><code>// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
  import &quot;controllers&quot;
  import 'offcanvas';
  
  //= require jquery3
  //= require jquery_ujs
  //= require jquery-ui
  //= require popper
  //= require bootstrap
  //= require activestorage
  //= require font_awesome5
  //= require tinymce
  
  
  
  window.jQuery = $;
  window.$ = $;
  </code></pre>
  <p>Can anyone see where I'm going wrong?</p>