Skip to content

JavaScript not working for Bootstrap 5 on Rails 7 #66

@umk1

Description

@umk1

Hello,
I have started learning Ruby on Rails recently. I tried to install Bootstrap 5 with Rails 7 using this gem.
The bootstrap framework is installed, but JavaScript is not working and no dropdown menu is displayed. I tried with Navbar sample code from bootstrap website (https://getbootstrap.com/docs/5.1/components/navbar/ ), but drop-down in the Navbar does not work. Tried on Firefox browser and Google Chrome.

I did installation exactly as per instructions.

  1. Added cssbundling-rails to Gemfile with gem 'cssbundling-rails'
  2. Run $bundle install
  3. Run $rails css:install:bootstrap

Google Chrome terminal gives this error.
Uncaught TypeError: Failed to resolve module specifier "bootstrap". Relative references must start with either "/", "./", or "../".

Screenshot from 2022-01-15 20-42-56

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions