windowsにてmysql2のgemインストールを行いたいのですがうまくいきません。
gem install mysql2
を入力すると、
================================================================================ ====================== You've installed the binary version of mysql2. It was built using MySQL Connector/C version 6.1.11. It's recommended to use the exact same version to avoid potential issues. At the time of building this gem, the necessary DLL files were retrieved from: http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.11-win32.zip This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/R EADME. ================================================================================ ====================== Successfully installed mysql2-0.5.2-x64-mingw32 Parsing documentation for mysql2-0.5.2-x64-mingw32 Installing ri documentation for mysql2-0.5.2-x64-mingw32 Done installing documentation for mysql2 after 0 seconds 1 gem installed
とうまくいったように見えますが、
ridgepole -c database.yml -E development --apply --dry-run -f fuel/app/schema/config
と入力すると、
Failed to load libmysql.dll from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/mysql2-0 .5.2-x64-mingw32/vendor/libmysql.dll
とエラーが返ってきます。
なので、mysql connectorの64bit版をダウンロードして、
gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\mysql-connector\lib" --with-mysql-include="C:\mysql-connector\include"'
そのコネクタを見てmysql2をダウンロードするようにしてみたのですが、
Temporarily enhancing PATH for MSYS/MINGW... Installing required msys2 packages: mingw-w64-x86_64-libmariadbclient 警告: mingw-w64-x86_64-libmariadbclient-2.3.7-1 は最新です -- スキップ Building native extensions with: '--with-mysql-lib="C:\mysql-connector\lib" --wi th-mysql-include="C:\mysql-connector\include"' This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/ext/m ysql2 C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20181019-8684-1kf2yyq.rb extconf.rb --wi th-mysql-lib="C:\mysql-connector\lib" --with-mysql-include="C:\mysql-connector\i nclude" checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for rb_wait_for_single_fd()... yes ----- Using --with-mysql-dir=C:\mysql-connector ----- checking for -lmysqlclient... yes checking for mysql.h... yes checking for errmsg.h... yes checking for SSL_MODE_DISABLED in mysql.h... yes checking for SSL_MODE_PREFERRED in mysql.h... yes checking for SSL_MODE_REQUIRED in mysql.h... yes checking for SSL_MODE_VERIFY_CA in mysql.h... yes checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes checking for MYSQL.net.vio in mysql.h... yes checking for MYSQL.net.pvio in mysql.h... no checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes checking for my_bool in mysql.h... yes creating Makefile current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/ext/mysql 2 make "DESTDIR=" clean current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/ext/mysql 2 make "DESTDIR=" generating mysql2-x64-mingw32.def compiling client.c compiling infile.c compiling mysql2_ext.c compiling result.c compiling statement.c linking shared-object mysql2/mysql2.so client.o:client.c:(.text+0x2a9): undefined reference to `mysql_options4' collect2.exe: error: ld returned 1 exit status make: *** [Makefile:259: mysql2.so] 繧ィ繝ゥ繝シ 1 make failed, exit code 2 Gem files will remain installed in C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/mysql2 -0.5.2 for inspection. Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0 /mysql2-0.5.2/gem_make.out
という結果が返ってきて、mysql2のインストールに失敗します。
どなたか解決策はございませんでしょうか。
やっぱりmacでないと動かないのでしょうか。
よろしくお願いいたします。
あなたの回答
tips
プレビュー