Run `rake -T` on production mode throws errors

28 Views Asked by At

When I run Rake -T in production mode, rails throws error about missing pry gem. Who can help me explain why it happens?

My command: RAILS_ENV=production bundle exec rake -T

Ruby: "3.3.0"

Rails version: 7.1.3.2

Bundle command

bundle config set without 'development test'
bundle install -j 20 -r 5 && bundle clean --force

Error Stacktrace:

RAILS_ENV=production bundle exec rake -T:
0.240 bundler: failed to load command: rake (/usr/local/bin/rake)
0.240 /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/resolver.rb:332:in `raise_not_found!': Could not find gem 'pry' in locally installed gems. (Bundler::GemNotFound) 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/resolver.rb:392:in `block in prepare_dependencies'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/resolver.rb:377:in `each' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/resolver.rb:377:in `map'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/resolver.rb:377:in `prepare_dependencies' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/resolver.rb:61:in `setup_solver'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/resolver.rb:28:in `start' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/definition.rb:626:in `start_resolution'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/definition.rb:311:in `resolve' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/definition.rb:579:in `materialize'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/definition.rb:203:in `specs' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/definition.rb:270:in `specs_for'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/runtime.rb:18:in `setup' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler.rb:162:in `setup'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/setup.rb:26:in `block in <top (required)>' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/ui/shell.rb:159:in `with_level'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/ui/shell.rb:111:in `silence' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/setup.rb:26:in `\<top (required)\>'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/cli/exec.rb:56:in `require_relative' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/cli/exec.rb:56:in `kernel_load'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/cli/exec.rb:23:in `run' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/cli.rb:451:in `exec'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/cli.rb:34:in `dispatch'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/cli.rb:28:in `start'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/exe/bundle:28:in `block in <top (required)>' 0.240   from /usr/local/bundle/gems/bundler-2.5.7/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
0.240   from /usr/local/bundle/gems/bundler-2.5.7/exe/bundle:20:in `<top (required)>' 0.240   from /usr/local/bundle/bin/bundle:25:in `load'
0.240   from /usr/local/bundle/bin/bundle:25:in \`\<main\>'
-

failed to solve: process "/bin/sh -c test -z "$RAILS_MASTER_KEY" || RAILS_ENV=production bundle exec rake -T" did not complete successfully: exit code: 1

My Gemfile

group :development, :test do
  # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
  gem "debug", platforms: %i[mri windows]
  gem 'pry'
  gem 'pry-doc', '>= 0.6.0'

  # Help to kill N+1 queries and unused eager loading
  gem 'bullet'
end

Who can help me explain why rails throws error?

0

There are 0 best solutions below