Project

General

Profile

Bug #23842

unable to run rake tasks in production

Added by Ohad Levy 4 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Category:
rake tasks
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

rake aborted!
LoadError: cannot load such file -- factory_bot
/home/foreman/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/home/foreman/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/home/foreman/gems/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
/home/foreman/gems/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
/home/foreman/gems/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
/home/foreman/git/foreman/lib/tasks/seed.rake:1:in `<top (required)>'
/home/foreman/gems/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
/home/foreman/gems/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `block in load'
/home/foreman/gems/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
/home/foreman/gems/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
/home/foreman/gems/gems/railties-5.1.6/lib/rails/engine.rb:648:in `block in run_tasks_blocks'
/home/foreman/gems/gems/railties-5.1.6/lib/rails/engine.rb:648:in `each'
/home/foreman/gems/gems/railties-5.1.6/lib/rails/engine.rb:648:in `run_tasks_blocks'
/home/foreman/gems/gems/railties-5.1.6/lib/rails/application.rb:440:in `run_tasks_blocks'
/home/foreman/gems/gems/railties-5.1.6/lib/rails/engine.rb:457:in `load_tasks'
/home/foreman/gems/gems/railties-5.1.6/lib/rails/railtie.rb:185:in `public_send'
/home/foreman/gems/gems/railties-5.1.6/lib/rails/railtie.rb:185:in `method_missing'
/home/foreman/git/foreman/Rakefile:8:in `<top (required)>'
/home/foreman/gems/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `load'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:28:in `run'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/cli.rb:424:in `exec'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/cli.rb:27:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/cli.rb:18:in `start'
/home/foreman/gems/gems/bundler-1.16.2/exe/bundle:30:in `block in <top (required)>'
/home/foreman/gems/gems/bundler-1.16.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/foreman/gems/gems/bundler-1.16.2/exe/bundle:22:in `<top (required)>'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `load'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)
rake aborted!


Related issues

Related to Foreman - Feature #19968: Easy seeding for development environmentsClosed2017-06-08

Associated revisions

Revision b5fc39ee (diff)
Added by Ewoud Kohl van Wijngaarden 4 months ago

Fixes #23842 - Load factory_bot only when needed

By moving the factory_bot loading to when it's only needed we make it a
soft dependency. Production installs typically don't have factory_bot
installed which breaks rake tasks.

History

#1 Updated by Ohad Levy 4 months ago

  • Related to Feature #19968: Easy seeding for development environments added

#2 Updated by Ewoud Kohl van Wijngaarden 4 months ago

What is the exact command you used? In our pipeline db:migrate did work so I'm wondering if listing all rake tasks fails for example.

#3 Updated by The Foreman Bot 4 months ago

  • Assignee set to Ewoud Kohl van Wijngaarden
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5661 added

#4 Updated by Michael Moll 4 months ago

  • Legacy Backlogs Release (now unused) set to 353

#5 Updated by Ewoud Kohl van Wijngaarden 4 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#6 Updated by Ewoud Kohl van Wijngaarden 2 months ago

  • Triaged set to No
  • Category set to rake tasks

Also available in: Atom PDF