質問編集履歴

2

dockerfileの追加

2020/03/23 15:42

投稿

kobaryo04ysh
kobaryo04ysh

スコア29

test CHANGED
File without changes
test CHANGED
@@ -16,17 +16,187 @@
16
16
 
17
17
 
18
18
 
19
+
20
+
19
21
  ```console
20
22
 
21
- ~~略~~
22
-
23
- /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': Error relocating /usr/local/bundle/gems/mini_racer-0.2.9/lib/mini_racer_extension.so: backtrace_symbols: symbol not found - /usr/local/bundle/gems/mini_racer-0.2.9/lib/mini_racer_extension.so (LoadError)
23
+ $ docker-compose up
24
+
25
+ Starting 081600ebc6a4_blog_app_1 ... done
26
+
27
+ Attaching to 081600ebc6a4_blog_app_1
28
+
29
+ 081600ebc6a4_blog_app_1 | Traceback (most recent call last):
30
+
31
+ 081600ebc6a4_blog_app_1 | 46: from bin/rails:4:in `<main>'
32
+
33
+ 081600ebc6a4_blog_app_1 | 45: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require'
34
+
35
+ 081600ebc6a4_blog_app_1 | 44: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency'
36
+
37
+ 081600ebc6a4_blog_app_1 | 43: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require'
38
+
39
+ 081600ebc6a4_blog_app_1 | 42: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
40
+
41
+ 081600ebc6a4_blog_app_1 | 41: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
42
+
43
+ 081600ebc6a4_blog_app_1 | 40: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
44
+
45
+ 081600ebc6a4_blog_app_1 | 39: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
46
+
47
+ 081600ebc6a4_blog_app_1 | 38: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
48
+
49
+ 081600ebc6a4_blog_app_1 | 37: from /usr/local/bundle/gems/railties-5.2.4.1/lib/rails/commands.rb:18:in `<top (required)>'
50
+
51
+ 081600ebc6a4_blog_app_1 | 36: from /usr/local/bundle/gems/railties-5.2.4.1/lib/rails/command.rb:46:in `invoke'
52
+
53
+ 081600ebc6a4_blog_app_1 | 35: from /usr/local/bundle/gems/railties-5.2.4.1/lib/rails/command/base.rb:69:in `perform'
54
+
55
+ 081600ebc6a4_blog_app_1 | 34: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
56
+
57
+ 081600ebc6a4_blog_app_1 | 33: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
58
+
59
+ 081600ebc6a4_blog_app_1 | 32: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
60
+
61
+ 081600ebc6a4_blog_app_1 | 31: from /usr/local/bundle/gems/railties-5.2.4.1/lib/rails/commands/server/server_command.rb:142:in `perform'
62
+
63
+ 081600ebc6a4_blog_app_1 | 30: from /usr/local/bundle/gems/railties-5.2.4.1/lib/rails/commands/server/server_command.rb:142:in `tap'
64
+
65
+ 081600ebc6a4_blog_app_1 | 29: from /usr/local/bundle/gems/railties-5.2.4.1/lib/rails/commands/server/server_command.rb:145:in `block in perform'
66
+
67
+ 081600ebc6a4_blog_app_1 | 28: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require'
68
+
69
+ 081600ebc6a4_blog_app_1 | 27: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency'
70
+
71
+ 081600ebc6a4_blog_app_1 | 26: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require'
72
+
73
+ 081600ebc6a4_blog_app_1 | 25: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
74
+
75
+ 081600ebc6a4_blog_app_1 | 24: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
76
+
77
+ 081600ebc6a4_blog_app_1 | 23: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
78
+
79
+ 081600ebc6a4_blog_app_1 | 22: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
80
+
81
+ 081600ebc6a4_blog_app_1 | 21: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
82
+
83
+ 081600ebc6a4_blog_app_1 | 20: from /app/config/application.rb:7:in `<top (required)>'
84
+
85
+ 081600ebc6a4_blog_app_1 | 19: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
86
+
87
+ 081600ebc6a4_blog_app_1 | 18: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
88
+
89
+ 081600ebc6a4_blog_app_1 | 17: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
90
+
91
+ 081600ebc6a4_blog_app_1 | 16: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
92
+
93
+ 081600ebc6a4_blog_app_1 | 15: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
94
+
95
+ 081600ebc6a4_blog_app_1 | 14: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
96
+
97
+ 081600ebc6a4_blog_app_1 | 13: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
98
+
99
+ 081600ebc6a4_blog_app_1 | 12: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
100
+
101
+ 081600ebc6a4_blog_app_1 | 11: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
102
+
103
+ 081600ebc6a4_blog_app_1 | 10: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
104
+
105
+ 081600ebc6a4_blog_app_1 | 9: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
106
+
107
+ 081600ebc6a4_blog_app_1 | 8: from /usr/local/bundle/gems/mini_racer-0.2.9/lib/mini_racer.rb:2:in `<top (required)>'
108
+
109
+ 081600ebc6a4_blog_app_1 | 7: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require'
110
+
111
+ 081600ebc6a4_blog_app_1 | 6: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency'
112
+
113
+ 081600ebc6a4_blog_app_1 | 5: from /usr/local/bundle/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require'
114
+
115
+ 081600ebc6a4_blog_app_1 | 4: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
116
+
117
+ 081600ebc6a4_blog_app_1 | 3: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
118
+
119
+ 081600ebc6a4_blog_app_1 | 2: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
120
+
121
+ 081600ebc6a4_blog_app_1 | 1: from /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
122
+
123
+ 081600ebc6a4_blog_app_1 | /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': Error relocating /usr/local/bundle/gems/mini_racer-0.2.9/lib/mini_racer_extension.so: backtrace_symbols: symbol not found - /usr/local/bundle/gems/mini_racer-0.2.9/lib/mini_racer_extension.so (LoadError)
124
+
125
+ 081600ebc6a4_blog_app_1 | 081600ebc6a4_blog_app_1 exited with code 1
24
126
 
25
127
 
26
128
 
27
129
  ```
28
130
 
131
+
132
+
133
+ ```Dockerfile
134
+
135
+ FROM ruby:2.5.7-alpine3.11
136
+
137
+
138
+
139
+ ENV LANG C.UTF-8 \
140
+
141
+ TZ Asia/Tokyo
142
+
143
+
144
+
145
+ ENV BUILD_PACKAGES="build-base" \
146
+
147
+ DB_PACKAGES="sqlite-dev postgresql-dev" \
148
+
149
+ RAILS_PACKAGES="tzdata nodejs imagemagick" \
150
+
151
+ FAVORITE_PACKAGES="less"
152
+
153
+
154
+
155
+ RUN apk update && \
156
+
157
+ apk upgrade && \
158
+
29
- trace backの部分は少し長いので省略しています。
159
+ apk add git && \
160
+
161
+ apk --update --no-cache add \
162
+
163
+ ${BUILD_PACKAGES} \
164
+
165
+ ${DB_PACKAGES} \
166
+
167
+ ${RAILS_PACKAGES} \
168
+
169
+ ${FAVORITE_PACKAGES}
170
+
171
+
172
+
173
+ WORKDIR /app
174
+
175
+
176
+
177
+ COPY Gemfile \
178
+
179
+ Gemfile.lock \
180
+
181
+ /app/
182
+
183
+
184
+
185
+ RUN gem install bundler && bundle install
186
+
187
+
188
+
189
+ # 下記のコードは、頻繁に Gemfile を変更する場合、コメントアウトを推奨します。
190
+
191
+ # RUN apk del ${BUILD_PACKAGES}
192
+
193
+
194
+
195
+ # https://github.com/bundler/bundler/issues/6154
196
+
197
+ ENV BUNDLE_GEMFILE='/app/Gemfile'
198
+
199
+ ```
30
200
 
31
201
 
32
202
 

1

情報追加

2020/03/23 15:42

投稿

kobaryo04ysh
kobaryo04ysh

スコア29

test CHANGED
File without changes
test CHANGED
@@ -34,6 +34,18 @@
34
34
 
35
35
 
36
36
 
37
+ ###試したこと
38
+
39
+
40
+
41
+ Gemfileのmini racerをコメントアウト→docker-compose up
42
+
43
+ こちらの方法では成功し、アプリケーションサーバーも立ち上がり、localhostで表示もできました。
44
+
45
+
46
+
47
+ このことから、やはりmini racer周りで何かが起きてるかと考えられます。
48
+
37
49
 
38
50
 
39
51
  ### 補足情報