質問編集履歴

2

質問の変更

2018/04/22 17:05

投稿

ruby_0ct
ruby_0ct

スコア57

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,10 @@
1
- bundle installを実行すると
1
+ bundle installを実行するとnokogiriのlibxml2に関するエラーが発生してしまいます。
2
+
3
+
4
+
2
-
5
+ ```
6
+
3
- ```Fetching nokogiri 1.8.1
7
+ Fetching nokogiri 1.8.1
4
8
 
5
9
  Installing nokogiri 1.8.1 with native extensions
6
10
 
@@ -10,7 +14,9 @@
10
14
 
11
15
  current directory: /Users/macbookpro/Documents/Ruby/members/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/ext/nokogiri
12
16
 
13
- /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180422-79958-3c4emb.rb extconf.rb --use-system-libraries
17
+ /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180423-89744-d6nawv.rb extconf.rb --use-system-libraries
18
+
19
+ --with-iconv-dir=/usr/local/opt/libiconv
14
20
 
15
21
  checking if the C compiler accepts ... yes
16
22
 
@@ -24,7 +30,7 @@
24
30
 
25
31
 
26
32
 
27
- gem install ç -v "~> 1.1"
33
+ gem install pkg-config -v "~> 1.1"
28
34
 
29
35
 
30
36
 
@@ -196,38 +202,94 @@
196
202
 
197
203
  ```
198
204
 
199
-
200
-
201
- エラーなりま
205
+ 以下Qiitaを参考にすると
206
+
202
-
207
+ [Qiita - OSX への nokogiri 1.6.8.rc3 の install でハマって解決したメモ](https://qiita.com/south37/items/63c938474bf35b30c988)
208
+
203
- pkg-configをイストールしろとことなんだと思ですが、
209
+ libxml2のリクがされてないことが原因のようですが、実際に見てみると
204
-
205
- gemには```pkg-config (1.3.0)```と```nokogiri (1.5.6)```がすでにインストールされています。
210
+
206
-
207
- また、homebrewにもpkg-configがインストールされています。
208
-
209
-
210
-
211
- 試しにエラー文通りに実行してみて
212
-
213
-
214
-
215
- ```
211
+ ```
216
-
212
+
217
- $ sudo gem install pkg-config -v "~> 1.1"
213
+ $ ls -la /usr/local/lib/ | grep libxml2
218
-
219
- Password:
214
+
220
-
221
- Successfully installed pkg-config-1.3.0
215
+ lrwxr-xr-x 1 macbookpro admin 43 4 22 02:46 libxml2.2.dylib -> ../Cellar/libxml2/2.9.7/lib/libxml2.2.dylib
222
-
216
+
223
- Parsing documentation for pkg-config-1.3.0
217
+ lrwxr-xr-x 1 macbookpro admin 37 4 22 02:46 libxml2.a -> ../Cellar/libxml2/2.9.7/lib/libxml2.a
218
+
224
-
219
+ lrwxr-xr-x 1 macbookpro admin 41 4 22 02:46 libxml2.dylib -> ../Cellar/libxml2/2.9.7/lib/libxml2.dylib
220
+
225
- Done installing documentation for pkg-config after 0 seconds
221
+ lrwxr-xr-x 1 macbookpro admin 39 4 22 02:46 xml2Conf.sh -> ../Cellar/libxml2/2.9.7/lib/xml2Conf.sh
226
-
227
- 1 gem installed
222
+
228
-
229
- ```
223
+ ```
224
+
230
-
225
+ すでにリンクがされています。
226
+
227
+
228
+
229
+ エラー文を検索しながらサイトに書いてあることを一通りやってみたのですがうまくいかず...
230
+
231
+
232
+
231
- 再度```bundle install```をやって見ても同じエラーになってしまいます。どうすれば、正常にbundle installが行われるでしょうか?
233
+ 再度```bundle install```をやって見ても同じエラーになってしまいます。どうすれば、正常に行われるでしょうか?
232
234
 
233
235
  解決策をご教授いただけると助かります。
236
+
237
+
238
+
239
+ #行ったこと
240
+
241
+
242
+
243
+ ```
244
+
245
+ $ bundle config build.nokogiri --use-system-libraries
246
+
247
+ You are replacing the current global value of build.nokogiri, which is currently "--use-system-libraries --with-iconv-dir=/usr/local/opt/libiconv"
248
+
249
+ ```
250
+
251
+ xcodeのコマンドラインツールのインストール
252
+
253
+ ```
254
+
255
+ $ xcode-select --install
256
+
257
+ xcode-select: error: command line tools are already installed, use "Software Update" to install updates
258
+
259
+ ```
260
+
261
+
262
+
263
+ リンクし直しても当然、すでにされていると言われる。
264
+
265
+ 「brewにいくつかインストールが必要だ」と書いてあっても、下記の環境の通り、全て揃っている。
266
+
267
+
268
+
269
+ # 環境
270
+
271
+ macOS High Sierra
272
+
273
+ gemにはすでに以下がインストール済みです。
274
+
275
+ ```
276
+
277
+ nokogiri (1.5.6)
278
+
279
+ pkg-config (1.3.0)
280
+
281
+ ```
282
+
283
+ homebrewには
284
+
285
+ ```
286
+
287
+ libiconv
288
+
289
+ libxslt
290
+
291
+ pkg-config
292
+
293
+ libxml2
294
+
295
+ ```

1

修正

2018/04/22 17:05

投稿

ruby_0ct
ruby_0ct

スコア57

test CHANGED
File without changes
test CHANGED
@@ -200,7 +200,17 @@
200
200
 
201
201
  とのエラーになります。
202
202
 
203
- pkg-configをインストールしろということなんだと思うので、以下の通りインストールして
203
+ pkg-configをインストールしろということなんだと思うのですが
204
+
205
+ gemには```pkg-config (1.3.0)```と```nokogiri (1.5.6)```がすでにインストールされています。
206
+
207
+ また、homebrewにもpkg-configがインストールされています。
208
+
209
+
210
+
211
+ 試しにエラー文通りに実行してみて
212
+
213
+
204
214
 
205
215
  ```
206
216