Skip to content

Commit

Permalink
Fix $LOAD_PATH to correctly require files
Browse files Browse the repository at this point in the history
Other I would get errors like:

LoadError: cannot load such file -- rails/api/generator (LoadError)

We were loading the installed rails gem and not the current subdirectories

This can be reproduced by doing `bundle clean --force` then `rake`

Fixes rails#50739
  • Loading branch information
Dorian Marié committed Jan 13, 2024
1 parent 4fb230d commit 210c984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

require "net/http"

$:.unshift __dir__
$LOAD_PATH.unshift __dir__
$LOAD_PATH.unshift(*Dir.glob(File.join(__dir__, "*", "lib")))

require "tasks/release"
require "railties/lib/rails/api/task"

Expand Down

0 comments on commit 210c984

Please sign in to comment.