Describe the bug
While running rails g rails_admin:install it fails with an error
Reproduction steps
created a new rails project with ruby 3.2.1 and rails 7.0.4
add gem 'rails_admin', '~> 3.1', '>= 3.1.1' to gemfile
bundle installrails g rails_admin:install
Expected behavior
Installs normally and works
Additional context
rails version: >= 7.0.4.3
rails_admin version: >= 3.1.1
rails_admin npm package version: 9.5.0
full stack trace (if there's an exception)
rails g rails_admin:install
? Where do you want to mount rails_admin? Press for [admin] >
route mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
create config/initializers/rails_admin.rb
Using [importmap] for asset delivery method
run yarn add rails_admin@3.1.1 from "."
create app/javascript/rails_admin.js
/Users/jacob/.rvm/gems/ruby-3.2.1/gems/rails_admin-3.1.1/lib/generators/rails_admin/importmap_formatter.rb:17:in format': undefined method[]' for nil:NilClass (NoMethodError)
imports['@popperjs/core'].gsub!('lib/index.js', 'dist/esm/popper.js')
^^^^^^^^^^^^^^^^^^
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/rails_admin-3.1.1/lib/generators/rails_admin/install_generator.rb:88:in configure_for_importmap' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/rails_admin-3.1.1/lib/generators/rails_admin/install_generator.rb:33:ininstall'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:in block in invoke_all' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:ineach'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:in map' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:ininvoke_all'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/group.rb:232:in dispatch' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/base.rb:485:instart'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/generators.rb:263:in invoke' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/commands/generate/generate_command.rb:26:inperform'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:inperform'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/command.rb:48:in invoke' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in'
from <internal:/Users/jacob/.rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in require' from <internal:/Users/jacob/.rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:inrequire'
from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' from bin/rails:4:in'
Describe the bug While running
rails g rails_admin:install
it fails with an errorReproduction steps created a new rails project with ruby 3.2.1 and rails 7.0.4 add
gem 'rails_admin', '~> 3.1', '>= 3.1.1'
to gemfilebundle install
rails g rails_admin:install
Expected behavior Installs normally and works
Additional context
rails
version: >= 7.0.4.3rails_admin
version: >= 3.1.1rails_admin
npm package version: 9.5.0full stack trace (if there's an exception) rails g rails_admin:install ? Where do you want to mount rails_admin? Press for [admin] >
route mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
create config/initializers/rails_admin.rb
Using [importmap] for asset delivery method run yarn add rails_admin@3.1.1 from "." create app/javascript/rails_admin.js /Users/jacob/.rvm/gems/ruby-3.2.1/gems/rails_admin-3.1.1/lib/generators/rails_admin/importmap_formatter.rb:17:in
format': undefined method
[]' for nil:NilClass (NoMethodError)imports['@popperjs/core'].gsub!('lib/index.js', 'dist/esm/popper.js') ^^^^^^^^^^^^^^^^^^ from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/rails_admin-3.1.1/lib/generators/rails_admin/install_generator.rb:88:in'
from <internal:/Users/jacob/.rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in '
configure_for_importmap' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/rails_admin-3.1.1/lib/generators/rails_admin/install_generator.rb:33:in
install' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/command.rb:27:inrun' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:127:in
invoke_command' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:inblock in invoke_all' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:in
each' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:inmap' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:134:in
invoke_all' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/group.rb:232:indispatch' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/base.rb:485:in
start' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/generators.rb:263:ininvoke' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/commands/generate/generate_command.rb:26:in
perform' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/command.rb:27:inrun' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor/invocation.rb:127:in
invoke_command' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/thor-1.2.1/lib/thor.rb:392:indispatch' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in
perform' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/command.rb:48:ininvoke' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in
require' from <internal:/Users/jacob/.rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in
require' from /Users/jacob/.rvm/gems/ruby-3.2.1/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:inrequire' from bin/rails:4:in
Add any other context about the problem here.