Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
545f3a4f
Commit
545f3a4f
authored
Sep 08, 2021
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset bundler settings after locating Gemfile
parent
3f75abbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
12 deletions
+22
-12
bin/bundle
bin/bundle
+1
-4
config/boot.rb
config/boot.rb
+1
-7
config/bundler_setup.rb
config/bundler_setup.rb
+20
-1
No files found.
bin/bundle
View file @
545f3a4f
#!/usr/bin/env ruby
require
'bundler'
ENV
[
'BUNDLE_GEMFILE'
]
||=
Bundler
.
settings
[
:gemfile
]
||
File
.
expand_path
(
'../Gemfile'
,
__dir__
)
require_relative
'../config/bundler_setup'
load
Gem
.
bin_path
(
'bundler'
,
'bundle'
)
config/boot.rb
View file @
545f3a4f
# frozen_string_literal: true
require
'bundler'
ENV
[
'BUNDLE_GEMFILE'
]
||=
Bundler
.
settings
[
:gemfile
]
||
File
.
expand_path
(
'../Gemfile'
,
__dir__
)
# Set up gems listed in the Gemfile.
require
'bundler/setup'
if
File
.
exist?
(
ENV
[
'BUNDLE_GEMFILE'
])
require_relative
'bundler_setup'
require
'bootsnap/setup'
if
ENV
[
'RAILS_ENV'
]
!=
'production'
||
%w(1 yes true)
.
include?
(
ENV
[
'ENABLE_BOOTSNAP'
])
config/bundler_setup.rb
View file @
545f3a4f
# frozen_string_literal: true
# Instead of requiring 'bundle/setup' directly, we need the following
# to make bundler more consistent when it comes to loading from
# bundler config. See the following links for more context:
# https://gitlab.com/gitlab-org/gitlab/-/issues/339939
# https://github.com/rubygems/rubygems/pull/4892
# https://github.com/rubygems/rubygems/issues/3363
require
'bundler'
ENV
[
'BUNDLE_GEMFILE'
]
||=
Bundler
.
settings
[
:gemfile
]
ENV
[
'BUNDLE_GEMFILE'
]
||=
Bundler
.
settings
[
:gemfile
]
||
File
.
expand_path
(
'../Gemfile'
,
__dir__
)
Bundler
::
SharedHelpers
.
set_env
(
'BUNDLE_GEMFILE'
,
ENV
[
'BUNDLE_GEMFILE'
])
if
Bundler
.
respond_to?
(
:reset_settings_and_root!
)
Bundler
.
reset_settings_and_root!
else
# Bundler 2.1.4 does not have this method. Do the same as Bundler 2.2.26
# https://github.com/rubygems/rubygems/blob/bundler-v2.2.26/bundler/lib/bundler.rb#L612-L615
Bundler
.
instance_eval
do
@settings
=
nil
@root
=
nil
end
end
require
'bundler/setup'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment