Skip to content

Commit

Permalink
Use bundle exec when starting remote console
Browse files Browse the repository at this point in the history
The combination of Bundler 2, Heroku's Ruby buildpack, and Rails' own
binstubs for Rails 5.2 appears to cause a conflict when starting the
console for an application bundled with Bundler 2.x.

```
% production console
Running rails console on ⬢ app-production... up, run.5165 (Standard-1X)
You must use Bundler 2 or greater with this lockfile.
```

The solution is to invoke the console with `bundle exec`, which gets
around the mismatch of Bundler 1.x and 2.x and blocks the Rails console
from starting.
  • Loading branch information
geoffharcourt committed Feb 22, 2019
1 parent 8624adf commit df9204b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/parity/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def from_development?
end

def console
Kernel.system(command_for_remote("run rails console"))
Kernel.system(command_for_remote("run bundle exec rails console"))
end

def migrate
Expand Down
2 changes: 1 addition & 1 deletion spec/parity/environment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def heroku_backup
end

def heroku_console
"heroku run rails console --remote production"
"heroku run bundle exec rails console --remote production"
end

def git_push
Expand Down

0 comments on commit df9204b

Please sign in to comment.