Skip to content

Commit

Permalink
bundle binstubs bundler should be executed after bundle install
Browse files Browse the repository at this point in the history
Fixes:

`bundle binstubs bundler` doesn't generate `bin/bundle` for newly
generated Rails app.

```
...
(snip)
run  bundle binstubs bundler
The git source https://github.com/rails/web-console.git is not yet checked out.
Please run `bundle install` before trying to start your application
run  bundle install
Fetching https://github.com/rails/web-console.git
(snip)
...
```

Related to rails#33202
  • Loading branch information
bogdanvlviv committed Aug 11, 2018
1 parent 09e1452 commit 2c66781
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Expand Up @@ -298,8 +298,6 @@ def create_bin_files
build(:bin)
end

public_task :generate_bundler_binstub

def update_bin_files
build(:bin_when_updating)
end
Expand Down Expand Up @@ -471,7 +469,8 @@ def finish_template
end

public_task :apply_rails_template, :run_bundle
public_task :run_webpack, :generate_spring_binstubs
public_task :generate_bundler_binstub, :generate_spring_binstubs
public_task :run_webpack

def run_after_bundle_callbacks
@after_bundle_callbacks.each(&:call)
Expand Down
2 changes: 1 addition & 1 deletion railties/test/generators/app_generator_test.rb
Expand Up @@ -972,7 +972,7 @@ def test_after_bundle_callback
template
end

sequence = ["git init", "binstubs bundler", "install", "exec spring binstub --all", "echo ran after_bundle"]
sequence = ["git init", "install", "binstubs bundler", "exec spring binstub --all", "echo ran after_bundle"]
@sequence_step ||= 0
ensure_bundler_first = -> command, options = nil do
assert_equal sequence[@sequence_step], command, "commands should be called in sequence #{sequence}"
Expand Down

0 comments on commit 2c66781

Please sign in to comment.