質問するログイン新規登録

質問編集履歴

3

修正

2020/09/10 21:30

投稿

tomsuma
tomsuma

スコア38

title CHANGED
File without changes
body CHANGED
@@ -185,4 +185,23 @@
185
185
  end
186
186
 
187
187
  ```
188
+ ```
189
+ ターミナル
190
+
191
+
192
+ bundle install
193
+ Your Ruby version is 2.6.5, but your Gemfile
194
+ specified 2.6.3
195
+ ```
196
+ ```CircleCI
197
+ #!/bin/bash -eo pipefail
198
+ bundle install --path vendor/bundle
199
+ [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
200
+ Your Ruby version is 2.6.3, but your Gemfile specified 2.6.5
201
+
202
+ Exited with code exit status 18
203
+ CircleCI received exit code 18
204
+ ```
205
+
206
+
188
207
  最初のビルド時に渡される内容をそのままコピーしました

2

修正

2020/09/10 21:30

投稿

tomsuma
tomsuma

スコア38

title CHANGED
File without changes
body CHANGED
@@ -67,4 +67,122 @@
67
67
  - ruby/bundle-install
68
68
 
69
69
  ```
70
+
71
+ ```bundle
72
+ #!/usr/bin/env ruby
73
+ # frozen_string_literal: true
74
+
75
+ #
76
+ # This file was generated by Bundler.
77
+ #
78
+ # The application 'bundle' is installed as part of a gem, and
79
+ # this file is here to facilitate running it.
80
+ #
81
+
82
+ require "rubygems"
83
+
84
+ m = Module.new do
85
+ module_function
86
+
87
+ def invoked_as_script?
88
+ File.expand_path($0) == File.expand_path(__FILE__)
89
+ end
90
+
91
+ def env_var_version
92
+ ENV["BUNDLER_VERSION"]
93
+ end
94
+
95
+ def cli_arg_version
96
+ return unless invoked_as_script? # don't want to hijack other binstubs
97
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
98
+ bundler_version = nil
99
+ update_index = nil
100
+ ARGV.each_with_index do |a, i|
101
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
102
+ bundler_version = a
103
+ end
104
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
105
+ bundler_version = $1
106
+ update_index = i
107
+ end
108
+ bundler_version
109
+ end
110
+
111
+ def gemfile
112
+ gemfile = ENV["BUNDLE_GEMFILE"]
113
+ return gemfile if gemfile && !gemfile.empty?
114
+
115
+ File.expand_path("../../Gemfile", __FILE__)
116
+ end
117
+
118
+ def lockfile
119
+ lockfile =
120
+ case File.basename(gemfile)
121
+ when "gems.rb" then gemfile.sub(/.rb$/, gemfile)
122
+ else "#{gemfile}.lock"
123
+ end
124
+ File.expand_path(lockfile)
125
+ end
126
+
127
+ def lockfile_version
128
+ return unless File.file?(lockfile)
129
+ lockfile_contents = File.read(lockfile)
130
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
131
+ Regexp.last_match(1)
132
+ end
133
+
134
+ def bundler_version
135
+ @bundler_version ||=
136
+ env_var_version || cli_arg_version ||
137
+ lockfile_version
138
+ end
139
+
140
+ def bundler_requirement
141
+ return "#{Gem::Requirement.default}.a" unless bundler_version
142
+
143
+ bundler_gem_version = Gem::Version.new(bundler_version)
144
+
145
+ requirement = bundler_gem_version.approximate_recommendation
146
+
147
+ return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
148
+
149
+ requirement += ".a" if bundler_gem_version.prerelease?
150
+
151
+ requirement
152
+ end
153
+
154
+ def load_bundler!
155
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
156
+
157
+ activate_bundler
158
+ end
159
+
160
+ def activate_bundler
161
+ gem_error = activation_error_handling do
162
+ gem "bundler", bundler_requirement
163
+ end
164
+ return if gem_error.nil?
165
+ require_error = activation_error_handling do
166
+ require "bundler/version"
167
+ end
168
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
169
+ 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}'`"
170
+ exit 42
171
+ end
172
+
173
+ def activation_error_handling
174
+ yield
175
+ nil
176
+ rescue StandardError, LoadError => e
177
+ e
178
+ end
179
+ end
180
+
181
+ m.load_bundler!
182
+
183
+ if m.invoked_as_script?
184
+ load Gem.bin_path("bundler", "bundle")
185
+ end
186
+
187
+ ```
70
188
  最初のビルド時に渡される内容をそのままコピーしました

1

修正

2020/09/10 11:48

投稿

tomsuma
tomsuma

スコア38

title CHANGED
File without changes
body CHANGED
@@ -35,4 +35,36 @@
35
35
  ```
36
36
 
37
37
 
38
+ ```二回目エラー内容
39
+
40
+ Traceback (most recent call last):
41
+ 2: from /usr/local/bin/bundle:23:in `<main>'
42
+ 1: from /usr/local/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
43
+ /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)
44
+ To update to the latest version installed on your system, run `bundle update --bundler`.
45
+ To install the missing version, run `gem install bundler:2.1.4`
46
+
47
+ Exited with code exit status 1
48
+ CircleCI received exit code 1
49
+ ```
50
+
51
+ ```
52
+ version: 2.1
53
+ orbs:
54
+ ruby: circleci/ruby@0.1.2
55
+
56
+ jobs:
57
+ build:
58
+ docker:
59
+ - image: circleci/ruby:2.6.3-stretch-node
60
+ executor: ruby/default
61
+ steps:
62
+ - checkout
63
+ - run: gem install bundler:2.1.4
64
+ - run:
65
+ name: Which bundler?
66
+ command: bundle -v
67
+ - ruby/bundle-install
68
+
69
+ ```
38
70
  最初のビルド時に渡される内容をそのままコピーしました