質問編集履歴

3

修正

2020/09/10 21:30

投稿

tomsuma
tomsuma

スコア38

test CHANGED
File without changes
test CHANGED
@@ -372,4 +372,42 @@
372
372
 
373
373
  ```
374
374
 
375
+ ```
376
+
377
+ ターミナル
378
+
379
+
380
+
381
+
382
+
383
+ bundle install
384
+
385
+ Your Ruby version is 2.6.5, but your Gemfile
386
+
387
+ specified 2.6.3
388
+
389
+ ```
390
+
391
+ ```CircleCI
392
+
393
+ #!/bin/bash -eo pipefail
394
+
395
+ bundle install --path vendor/bundle
396
+
397
+ [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path 'vendor/bundle'`, and stop using this flag
398
+
399
+ Your Ruby version is 2.6.3, but your Gemfile specified 2.6.5
400
+
401
+
402
+
403
+ Exited with code exit status 18
404
+
405
+ CircleCI received exit code 18
406
+
407
+ ```
408
+
409
+
410
+
411
+
412
+
375
413
  最初のビルド時に渡される内容をそのままコピーしました

2

修正

2020/09/10 21:30

投稿

tomsuma
tomsuma

スコア38

test CHANGED
File without changes
test CHANGED
@@ -136,4 +136,240 @@
136
136
 
137
137
  ```
138
138
 
139
+
140
+
141
+ ```bundle
142
+
143
+ #!/usr/bin/env ruby
144
+
145
+ # frozen_string_literal: true
146
+
147
+
148
+
149
+ #
150
+
151
+ # This file was generated by Bundler.
152
+
153
+ #
154
+
155
+ # The application 'bundle' is installed as part of a gem, and
156
+
157
+ # this file is here to facilitate running it.
158
+
159
+ #
160
+
161
+
162
+
163
+ require "rubygems"
164
+
165
+
166
+
167
+ m = Module.new do
168
+
169
+ module_function
170
+
171
+
172
+
173
+ def invoked_as_script?
174
+
175
+ File.expand_path($0) == File.expand_path(__FILE__)
176
+
177
+ end
178
+
179
+
180
+
181
+ def env_var_version
182
+
183
+ ENV["BUNDLER_VERSION"]
184
+
185
+ end
186
+
187
+
188
+
189
+ def cli_arg_version
190
+
191
+ return unless invoked_as_script? # don't want to hijack other binstubs
192
+
193
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
194
+
195
+ bundler_version = nil
196
+
197
+ update_index = nil
198
+
199
+ ARGV.each_with_index do |a, i|
200
+
201
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
202
+
203
+ bundler_version = a
204
+
205
+ end
206
+
207
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
208
+
209
+ bundler_version = $1
210
+
211
+ update_index = i
212
+
213
+ end
214
+
215
+ bundler_version
216
+
217
+ end
218
+
219
+
220
+
221
+ def gemfile
222
+
223
+ gemfile = ENV["BUNDLE_GEMFILE"]
224
+
225
+ return gemfile if gemfile && !gemfile.empty?
226
+
227
+
228
+
229
+ File.expand_path("../../Gemfile", __FILE__)
230
+
231
+ end
232
+
233
+
234
+
235
+ def lockfile
236
+
237
+ lockfile =
238
+
239
+ case File.basename(gemfile)
240
+
241
+ when "gems.rb" then gemfile.sub(/.rb$/, gemfile)
242
+
243
+ else "#{gemfile}.lock"
244
+
245
+ end
246
+
247
+ File.expand_path(lockfile)
248
+
249
+ end
250
+
251
+
252
+
253
+ def lockfile_version
254
+
255
+ return unless File.file?(lockfile)
256
+
257
+ lockfile_contents = File.read(lockfile)
258
+
259
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
260
+
261
+ Regexp.last_match(1)
262
+
263
+ end
264
+
265
+
266
+
267
+ def bundler_version
268
+
269
+ @bundler_version ||=
270
+
271
+ env_var_version || cli_arg_version ||
272
+
273
+ lockfile_version
274
+
275
+ end
276
+
277
+
278
+
279
+ def bundler_requirement
280
+
281
+ return "#{Gem::Requirement.default}.a" unless bundler_version
282
+
283
+
284
+
285
+ bundler_gem_version = Gem::Version.new(bundler_version)
286
+
287
+
288
+
289
+ requirement = bundler_gem_version.approximate_recommendation
290
+
291
+
292
+
293
+ return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
294
+
295
+
296
+
297
+ requirement += ".a" if bundler_gem_version.prerelease?
298
+
299
+
300
+
301
+ requirement
302
+
303
+ end
304
+
305
+
306
+
307
+ def load_bundler!
308
+
309
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
310
+
311
+
312
+
313
+ activate_bundler
314
+
315
+ end
316
+
317
+
318
+
319
+ def activate_bundler
320
+
321
+ gem_error = activation_error_handling do
322
+
323
+ gem "bundler", bundler_requirement
324
+
325
+ end
326
+
327
+ return if gem_error.nil?
328
+
329
+ require_error = activation_error_handling do
330
+
331
+ require "bundler/version"
332
+
333
+ end
334
+
335
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
336
+
337
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
338
+
339
+ exit 42
340
+
341
+ end
342
+
343
+
344
+
345
+ def activation_error_handling
346
+
347
+ yield
348
+
349
+ nil
350
+
351
+ rescue StandardError, LoadError => e
352
+
353
+ e
354
+
355
+ end
356
+
357
+ end
358
+
359
+
360
+
361
+ m.load_bundler!
362
+
363
+
364
+
365
+ if m.invoked_as_script?
366
+
367
+ load Gem.bin_path("bundler", "bundle")
368
+
369
+ end
370
+
371
+
372
+
373
+ ```
374
+
139
375
  最初のビルド時に渡される内容をそのままコピーしました

1

修正

2020/09/10 11:48

投稿

tomsuma
tomsuma

スコア38

test CHANGED
File without changes
test CHANGED
@@ -72,4 +72,68 @@
72
72
 
73
73
 
74
74
 
75
+ ```二回目エラー内容
76
+
77
+
78
+
79
+ Traceback (most recent call last):
80
+
81
+ 2: from /usr/local/bin/bundle:23:in `<main>'
82
+
83
+ 1: from /usr/local/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
84
+
85
+ /usr/local/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /home/circleci/project/Gemfile.lock. (Gem::GemNotFoundException)
86
+
87
+ To update to the latest version installed on your system, run `bundle update --bundler`.
88
+
89
+ To install the missing version, run `gem install bundler:2.1.4`
90
+
91
+
92
+
93
+ Exited with code exit status 1
94
+
95
+ CircleCI received exit code 1
96
+
97
+ ```
98
+
99
+
100
+
101
+ ```
102
+
103
+ version: 2.1
104
+
105
+ orbs:
106
+
107
+ ruby: circleci/ruby@0.1.2
108
+
109
+
110
+
111
+ jobs:
112
+
113
+ build:
114
+
115
+ docker:
116
+
117
+ - image: circleci/ruby:2.6.3-stretch-node
118
+
119
+ executor: ruby/default
120
+
121
+ steps:
122
+
123
+ - checkout
124
+
125
+ - run: gem install bundler:2.1.4
126
+
127
+ - run:
128
+
129
+ name: Which bundler?
130
+
131
+ command: bundle -v
132
+
133
+ - ruby/bundle-install
134
+
135
+
136
+
137
+ ```
138
+
75
139
  最初のビルド時に渡される内容をそのままコピーしました