windowsでrails5の動作をみたくてアプリを作ったのですが、
以前動いていたバージョンなのに
mysql2をインストールする時にエラーになってしまいます。
環境
ruby 2.6 rails 5.2.6 windows10
ruby:gemfile
1gem 'mysql2' '~> 0.5.3'
エラーに関係ありそうなログとしては
pacman failed with the following output: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. current directory: C:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mysql2-0.5.4/ext/mysql2 C:/Ruby/Ruby26-x64/bin/ruby.exe -I C:/Ruby/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20220518-17112-1g39i40.rb extconf.rb checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for rb_wait_for_single_fd()... yes checking for rb_enc_interned_str() in ruby.h... no checking for -lmysqlclient... no ----- mysql client is missing. Check your installation of MySQL or Connector/C, and try again.
こんな感じでclientがないと言われてしまいます。
*mysql自体は5.7のものをPC内にインストールしています。
試したこと
エラーログに書いてある通りにmkfk.logを見に行ってみましたが、どれが正解なのか分かりませんでした。
ruby:C:\Ruby\Ruby26
1"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby/Ruby26-x64/include/ruby-2.6.0/x64-mingw32 -IC:/Ruby/Ruby26-x64/include/ruby-2.6.0/ruby/backward -IC:/Ruby/Ruby26-x64/include/ruby-2.6.0 -I. -I/usr/local/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -L. -LC:/Ruby/Ruby26-x64/lib -L/usr/local/lib -L/usr/local/lib/mysql -L. -pipe -s -lx64-msvcrt-ruby260 -lmysqlclient -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi " 2C:/Ruby/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmysqlclient 3collect2.exe: error: ld returned 1 exit status 4checked program was: 5/* begin */ 6 1: #include "ruby.h" 7 2: 8 3: #include <winsock2.h> 9 4: #include <windows.h> 10 5: 11 6: /*top*/ 12 7: extern int t(void); 13 8: int main(int argc, char **argv) 14 9: { 1510: if (argc > 1000000) { 1611: int (* volatile tp)(void)=(int (*)(void))&t; 1712: printf("%d", (*tp)()); 1813: } 1914: 2015: return 0; 2116: } 2217: 2318: int t(void) { ; return 0; } 24/* end */
よろしくお願い致します。
あなたの回答
tips
プレビュー