質問編集履歴

1

すみません。Markdownで「コード」に修正しました。

2022/05/08 11:53

投稿

Osat.Kaso
Osat.Kaso

スコア17

test CHANGED
File without changes
test CHANGED
@@ -14,8 +14,72 @@
14
14
   インストールを行う。
15
15
 
16
16
  4. 「gem install mysql2」コマンドで、MySQL(Gemパッケージ)のインストールを行うと、下記の通りエラーメッセージが表示されて、インストールができない。
17
- ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-05-08/28c939cf-5f2a-4095-97c7-82271632e27c.jpeg)
18
- ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-05-08/ac355123-f6b6-4aa9-b60a-2e609dc9151e.jpeg)
19
17
 
18
+ ``` (エラーメッセージ)
19
+ C:\>gem install mysql2
20
+ Temporarily enhancing PATH for MSYS/MINGW...
21
+ Using msys2 packages: mingw-w64-ucrt-x86_64-libmariadbclient
22
+ Building native extensions. This could take a while...
23
+ ERROR: Error installing mysql2:
24
+ ERROR: Failed to build gem native extension.
25
+
26
+ current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mysql2-0.5.4/ext/mysql2
27
+ C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220508-8380-ac6mj2.rb extconf.rb
28
+ checking for rb_absint_size()... yes
29
+ checking for rb_absint_singlebit_p()... yes
30
+ checking for rb_wait_for_single_fd()... yes
31
+ checking for rb_enc_interned_str() in ruby.h... yes
32
+ *** extconf.rb failed ***
33
+ Could not create Makefile due to some reason, probably lack of necessary
34
+ libraries and/or headers. Check the mkmf.log file for more details. You may
35
+ need configuration options.
36
+
37
+ Provided configuration options:
38
+ --with-opt-dir
39
+ --without-opt-dir
40
+ --with-opt-include
41
+ --without-opt-include=${opt-dir}/include
42
+ --with-opt-lib
43
+ --without-opt-lib=${opt-dir}/lib
44
+ --with-make-prog
45
+ --without-make-prog
46
+ --srcdir=.
47
+ --curdir
48
+ --ruby=C:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
49
+ --with-mysql-dir
50
+ --without-mysql-dir
51
+ --with-mysql-include
52
+ --without-mysql-include=${mysql-dir}/include
53
+ --with-mysql-lib
54
+ --without-mysql-lib=${mysql-dir}/lib
55
+ --with-mysql-config
56
+ --without-mysql-config
57
+ --with-mysqlclient-dir
58
+ --without-mysqlclient-dir
59
+ --with-mysqlclient-include
60
+ --without-mysqlclient-include=${mysqlclient-dir}/include
61
+ --with-mysqlclient-lib
62
+ --without-mysqlclient-lib=${mysqlclient-dir}/lib
63
+ --with-mysqlclientlib
64
+ --without-mysqlclientlib
65
+ C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1086:in `block in find_library': undefined method `split' for nil:NilClass (NoMethodError)
66
+
67
+ paths = paths.flat_map {|path| path.split(File::PATH_SEPARATOR)}
68
+ ^^^^^^
69
+ from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1086:in `each'
70
+ from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1086:in `flat_map'
71
+ from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1086:in `find_library'
72
+ from extconf.rb:103:in `<main>'
73
+
74
+ To see why this extension failed to compile, please check the mkmf.log which can be found here:
75
+
76
+ C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/mysql2-0.5.4/mkmf.log
77
+
78
+ extconf failed, exit code 1
79
+
80
+ Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mysql2-0.5.4 for inspection.
81
+ Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/mysql2-0.5.4/gem_make.out
82
+
83
+ ```
20
84
  私は、このようになる理由がわかりません。
21
85
  どなたか、どのようにすれば、うまくいくのかを、ご教授お願いします。