← homeProgramming (Програмування)

[Fix] Rails Admin - undefined local variable or method javascript_importmap_shim_nonce_configuration_tag

After updating Ruby Gems, an error occurred on the Rails Admin page. undefined local variable or method `javascript_importmap_shim_nonce_configuration_tag' for #<ActionView::Base:0x00000000017908> NameError in R...

This content has been automatically translated from Ukrainian.
After updating Ruby Gems, an error occurred on the Rails Admin page.
undefined local variable or method `javascript_importmap_shim_nonce_configuration_tag' for #<ActionView::Base:0x00000000017908>

NameError in RailsAdmin::Main#dashboard

Showing /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rails_admin-3.1.2/app/views/layouts/rails_admin/_head.html.erb where line #22 raised:
undefined local variable or method `javascript_importmap_shim_nonce_configuration_tag' for #<ActionView::Base:0x00000000017908>
Extracted source (around line #22):
undefined local variable or method `javascript_importmap_shim_nonce_configuration_tag' for #<ActionView::Base:0x00000000017908>
undefined local variable or method `javascript_importmap_shim_nonce_configuration_tag' for #<ActionView::Base:0x00000000017908>
This happened due to the update to the major version of importmap-rails.
importmap-rails оновлення
importmap-rails оновлення
So currently the simplest fix is to lock the version in the Gemfile:
gem "importmap-rails", "~> 1.1.5"
Then:
bundle install
And Rails Admin should work. I haven't read in detail the benefits of updating to importmap-rails, but evidently Rails Admin does not currently support this version. So we need to wait a bit for the update of this library.

🔥 More posts

All posts
Programming (Програмування)May 7, '24 07:24

What is native machine code?

Native machine code is a type of software code that is executed directly by a computer's processo...

What is technical debt in IT projects?
Programming (Програмування)May 13, '24 06:17

What is technical debt in IT projects?

Technical debt is like a loan you take to speed up the development of a software product, but the...

What is "scope creep"?
Terms (Терміни)May 13, '24 07:20

What is "scope creep"?

Scope Creep (scope creep) - is the uncontrolled increase in the scope of work in a project, often...

ZOMBIE in Ruby. What is it?
Programming (Програмування)May 3, '24 12:41

ZOMBIE in Ruby. What is it?

Ruby is a programming language. Everything is clear here. In the code of this language, you may e...

What does "Native" mean?
Terms (Терміни)May 22, '24 07:01

What does "Native" mean?

The term "native" comes from the Latin word "nativus," which means "born" or "natural." This word...