You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Inject bundler version into BundlerWrapper
* Install injected Bundler Version
Previously the BundlerWrapper reads the Gemfile.lock to extract BUNDLED WITH and then resolves this to a specific **known** good version of bundler.
Now, the version is still parsed from the Gemfile.lock, but this is passed in. Instead of resolving to a specific bundler version, we use the version specified in the customer's Gemfile.lock.
Keep in mind that the version of bundler used by the platform will use the largest version present on the system, which could also be the default bundler version that ships with Ruby.
* Add warning
* Remove "escape valve" as this is no longer needed
This feature prevented bundler from re-exec-ing with the version of bundler in the `Gemfile.lock`. Since we're now installing an exact match, this is no longer needed.
* Remove unused code
* Prefer inline private
* Remove unused errors
These errors are not constructed anymore
* Changelog
* Improve lockfile parser error
Previously when this script failed it was difficult to understand
```
StandardError:
Command: 'ruby -e require\ \"json\"'
'require\ \"bundler\"'
''
'path\ \=\ ARGV\[0\]\ or\ raise\ \"First\ argument\ must\ be\ the\ path\ to\ the\ Gemfile.lock\"'
'specs\ \=\ Bundler::LockfileParser.new\(File.read\(path\)\)'
'\ \ .specs'
'\ \ .each_with_object\(\{\}\)\ \{\|spec,\ hash\|\ hash\[spec.name.to_s\]\ \=\ spec.version.to_s\ \}'
'puts\ specs.to_json'
' ''' failed unexpectedly:
# ./lib/language_pack/shell_helpers.rb:80:in `block in run!'
```
This is from the Gemfile.lock file being `nil`.
Part of the problem is that the script is shell encoded and present in the output. The other problem is that redirecting stderr to `/dev/null` hides the error message "No such file or directory" from the output.
This change pushes the IO failures and input failures outside of the script and uses Open3 and a tempfile to separate out stdout from stderr without losing stderr.
* fixup! Inject bundler version into BundlerWrapper
## Ruby applications now receive exact bundler version
2
+
3
+
The exact bundler version from the `Gemfile.lock` is now installed with no conversion.
4
+
5
+
If your application fails after this change, you can manually adjust your `BUNDLED WITH` value in the `Gemfile.lock` to match the previously used exact version:
6
+
7
+
-`BUNDLED WITH 1.x.` installs `bundler 1.17.3`
8
+
-`BUNDLED WITH 2.0.x to 2.3.x` installs `bundler 2.3.25`
9
+
-`BUNDLED WITH 2.4.x` installs `bundler 2.4.22`
10
+
-`BUNDLED WITH 2.5.x` installs `bundler 2.5.23`
11
+
-`BUNDLED WITH 2.6.x` installs `bundler 2.6.9`
12
+
-`BUNDLED WITH 2.7.x` installs `bundler 2.7.2`
13
+
-`BUNDLED WITH 4.0.x` installs `bundler 4.0.0`
14
+
15
+
For example, if your application started failing, using bundler 2.6.1, you could adjust it to instead use the 2.6.x series above which would be:
16
+
17
+
```
18
+
BUNDLED WITH
19
+
2.6.9
20
+
```
21
+
22
+
Applications without a `BUNDLED WITH` value will receive a [default bundler version ](https://devcenter.heroku.com/articles/ruby-support-reference#default-bundler-version).
0 commit comments