cbeer / engine_cart

Rake tasks to generate test applications for Rails Engines
MIT License
18 stars 16 forks source link

Rails 7 assets install fails #107

Closed jcoyne closed 3 months ago

jcoyne commented 2 years ago

It seems like it can't find the rails tasks for the gem it just installed:

Using rails 7.0.0.rc1
Using importmap-rails 0.9.3
Using stimulus-rails 0.7.3
Using turbo-rails 7.1.1
Bundle complete! 11 Gemfile dependencies, 53 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
         run  bundle binstubs bundler
       rails  importmap:install
DEPRECATION WARNING: This manually engine loading is deprecated and will be removed in v3.0.0. Remove `require "view_component/engine"`. (called from <top (required)> at /Users/jcoyne85/workspace/projectblacklight/blacklight/lib/blacklight/engine.rb:3)
DEPRECATION WARNING: This manually engine loading is deprecated and will be removed in v3.0.0. Remove `require "view_component/engine"`. (called from <top (required)> at /Users/jcoyne85/workspace/projectblacklight/blacklight/lib/blacklight/engine.rb:3)
warning: parser/current is loading parser/ruby27, which recognizes
warning: 2.7.5-compliant syntax, but you are running 2.7.2.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
rails aborted!
Don't know how to build task 'importmap:install' (See the list of available tasks with `rails --tasks`)

(See full trace by running task with --trace)

The gem is added here: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/app_base.rb#L317

and bundle install is called here: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/app_base.rb#L414 And the generator is called here: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/app_base.rb#L421

Possibly the problem is: "BUNDLE_GEMFILE"=>"/Users/jcoyne85/workspace/projectblacklight/blacklight/Gemfile"

jcoyne commented 3 months ago

On ruby 3.2 we see this manifestation of the problem in Spotlight. Curiously, we do not see this error in Blacklight.

...
Installing rails 7.0.8.4
Bundle complete! 11 Gemfile dependencies, 62 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
         run  bundle binstubs bundler
       rails  importmap:install
/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/definition.rb:594:in `materialize': Could not find rails-7.0.8.4, sprockets-rails-3.5.1, sqlite3-1.7.3-x86_64-linux, puma-5.6.8, importmap-rails-2.0.1, turbo-rails-2.0.5, stimulus-rails-1.3.3, debug-1.9.2, web-console-4.2.1, actioncable-7.0.8.4, actionmailbox-7.0.8.4, actionmailer-7.0.8.4, actionpack-7.0.8.4, actiontext-7.0.8.4, actionview-7.0.8.4, activejob-7.0.8.4, activemodel-7.0.8.4, activerecord-7.0.8.4, activestorage-7.0.8.4, activesupport-7.0.8.4, railties-7.0.8.4, sprockets-4.2.1, irb-1.13.2, reline-0.5.9, bindex-0.8.1, rdoc-6.7.0, io-console-0.7.2, psych-5.1.2, stringio-3.1.1 in locally installed gems (Bundler::GemNotFound)
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/definition.rb:193:in `specs'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/definition.rb:259:in `specs_for'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/runtime.rb:18:in `setup'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler.rb:164:in `setup'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/setup.rb:32:in `block in <top (required)>'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/ui/shell.rb:159:in `with_level'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/ui/shell.rb:111:in `silence'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/setup.rb:32:in `<top (required)>'
    from <internal:/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
    from <internal:/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems.rb:1370:in `<top (required)>'
    from <internal:gem_prelude>:2:in `require'
    from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
       rails  turbo:install stimulus:install
/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/definition.rb:594:in `materialize': Could not find rails-7.0.8.4, sprockets-rails-3.5.1, sqlite3-1.7.3-x86_64-linux, puma-5.6.8, importmap-rails-2.0.1, turbo-rails-2.0.5, stimulus-rails-1.3.3, debug-1.9.2, web-console-4.2.1, actioncable-7.0.8.4, actionmailbox-7.0.8.4, actionmailer-7.0.8.4, actionpack-7.0.8.4, actiontext-7.0.8.4, actionview-7.0.8.4, activejob-7.0.8.4, activemodel-7.0.8.4, activerecord-7.0.8.4, activestorage-7.0.8.4, activesupport-7.0.8.4, railties-7.0.8.4, sprockets-4.2.1, irb-1.13.2, reline-0.5.9, bindex-0.8.1, rdoc-6.7.0, io-console-0.7.2, psych-5.1.2, stringio-3.1.1 in locally installed gems (Bundler::GemNotFound)
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/definition.rb:193:in `specs'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/definition.rb:259:in `specs_for'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/runtime.rb:18:in `setup'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler.rb:164:in `setup'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/setup.rb:32:in `block in <top (required)>'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/ui/shell.rb:159:in `with_level'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/ui/shell.rb:111:in `silence'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/gems/3.2.0/gems/bundler-2.5.14/lib/bundler/setup.rb:32:in `<top (required)>'
    from <internal:/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
    from <internal:/opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
    from /opt/hostedtoolcache/Ruby/3.2.4/x64/lib/ruby/3.2.0/rubygems.rb:1370:in `<top (required)>'
    from <internal:gem_prelude>:2:in `require'
    from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
jcoyne commented 3 months ago

This was caused by using the github bundler caching.