Ruby on Windows: Cannot install mysql2 gem - Failed to build gem native extension -


i tried follow posts here , there

but i'm near enough reach truth answer problem.

is there else i'm missing here?

d:\projects\ruby\cms>gem install mysql2 --platform=ruby -- '--with-mysql-dir="c:\mysql-connector-c-6.1.3-winx64"' temporarily enhancing path include devkit... building native extensions.  take while... error:  error installing mysql2:     error: failed build gem native extension.      c:/railsinstaller/ruby1.9.3/bin/ruby.exe extconf.rb --with-mysql-dir="c:\mysql-connector-c-6.1.3-winx64" checking ruby/thread.h... no checking rb_thread_blocking_region()... yes checking rb_wait_for_single_fd()... yes checking rb_hash_dup()... yes checking rb_intern3()... yes ----- using --with-mysql-dir=c:\mysql-connector-c-6.1.3-winx64 ----- checking main() in -llibmysql... yes checking mysql.h... yes checking errmsg.h... yes checking mysqld_error.h... yes ----- setting rpath /lib ----- creating makefile  make generating mysql2-i386-mingw32.def compiling client.c client.c: in function 'finish_and_mark_inactive': client.c:513:3: warning: iso c90 forbids mixed declarations , code compiling infile.c compiling mysql2_ext.c compiling result.c result.c: in function 'rb_mysql_result_fetch_fields': result.c:415:35: warning: comparison between signed , unsigned integer expressions linking shared-object mysql2/mysql2.so client.o: in function `nogvl_connect': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:157: undefined reference `mysql_real_connect@32' client.o: in function `nogvl_init': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:146: undefined reference `mysql_init@4' client.o: in function `set_ssl_options': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:1102: undefined reference `mysql_ssl_set@24' client.o: in function `mysql_client_options': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:744: undefined reference `mysql_options@12' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:748: undefined reference `mysql_error@4' client.o: in function `rb_mysql_info': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:271: undefined reference `mysql_info@4' client.o: in function `rb_mysql_client_warning_count': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:261: undefined reference `mysql_warning_count@4' client.o: in function `nogvl_do_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:375: undefined reference `mysql_store_result@4' client.o: in function `rb_mysql_client_more_results': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:947: undefined reference `mysql_more_results@4' client.o: in function `nogvl_select_db': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:887: undefined reference `mysql_select_db@8' client.o: in function `nogvl_ping': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:918: undefined reference `mysql_ping@4' client.o: in function `rb_mysql_client_thread_id': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:880: undefined reference `mysql_thread_id@4' client.o: in function `rb_mysql_client_last_id': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:849: undefined reference `mysql_insert_id@4' client.o: in function `nogvl_read_query_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:362: undefined reference `mysql_read_query_result@4' client.o: in function `rb_mysql_client_server_info': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:809: undefined reference `mysql_get_server_version@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:810: undefined reference `mysql_get_server_info@4' client.o: in function `rb_mysql_client_info': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:777: undefined reference `mysql_get_client_version@0' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:778: undefined reference `mysql_get_client_info@0' client.o: in function `rb_mysql_client_real_escape': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:667: undefined reference `mysql_real_escape_string@16' client.o: in function `finish_and_mark_inactive': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:520: undefined reference `mysql_free_result@4' client.o: in function `nogvl_send_query': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:339: undefined reference `mysql_send_query@12' client.o: in function `nogvl_close': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:189: undefined reference `mysql_close@4' client.o: in function `rb_mysql_client_escape': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:242: undefined reference `mysql_escape_string@12' client.o: in function `rb_raise_mysql2_error': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:125: undefined reference `mysql_error@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:126: undefined reference `mysql_sqlstate@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:135: undefined reference `mysql_errno@4' client.o: in function `rb_connect': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:301: undefined reference `mysql_errno@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:309: undefined reference `mysql_get_server_version@4' client.o: in function `rb_mysql_client_store_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:990: undefined reference `mysql_errno@4' client.o: in function `rb_mysql_client_next_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:963: undefined reference `mysql_next_result@4' client.o: in function `rb_mysql_client_affected_rows': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:863: undefined reference `mysql_affected_rows@4' client.o: in function `rb_mysql_client_async_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:424: undefined reference `mysql_errno@4' client.o: in function `rb_mysql_client_abandon_results': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:544: undefined reference `mysql_next_result@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:543: undefined reference `mysql_more_results@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:552: undefined reference `mysql_free_result@4' client.o: in function `nogvl_do_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:373: undefined reference `mysql_use_result@4' client.o: in function `nogvl_close': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:189: undefined reference `mysql_close@4' client.o: in function `set_charset_name': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:1091: undefined reference `mysql_options@12' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:1093: undefined reference `mysql_error@4' client.o: in function `nogvl_close': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:189: undefined reference `mysql_close@4' client.o: in function `init_mysql2_client': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/client.c:1141: undefined reference `mysql_get_client_info@0' infile.o: in function `mysql2_set_local_infile': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/infile.c:114: undefined reference `mysql_set_local_infile_handler' result.o: in function `rb_mysql_result_count': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:592: undefined reference `mysql_num_rows@4' result.o: in function `rb_mysql_result_fetch_field': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:123: undefined reference `mysql_fetch_field_direct@8' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:111: undefined reference `mysql_num_fields@4' result.o: in function `rb_mysql_result_fetch_fields': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:411: undefined reference `mysql_num_fields@4' result.o: in function `nogvl_fetch_row': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:102: undefined reference `mysql_fetch_row@4' result.o: in function `rb_mysql_result_free_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:76: undefined reference `mysql_free_result@4' result.o: in function `rb_mysql_result_fetch_row': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:209: undefined reference `mysql_fetch_lengths@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:211: undefined reference `mysql_num_fields@4' result.o: in function `rb_mysql_result_each': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:512: undefined reference `mysql_fetch_fields@4' result.o: in function `rb_mysql_result_free_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:76: undefined reference `mysql_free_result@4' result.o: in function `rb_mysql_result_each': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:530: undefined reference `mysql_error@4' c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:547: undefined reference `mysql_fetch_fields@4' result.o: in function `rb_mysql_result_free_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:76: undefined reference `mysql_free_result@4' result.o: in function `rb_mysql_result_each': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:499: undefined reference `mysql_num_rows@4' result.o: in function `rb_mysql_result_free_result': c:\railsinstaller\ruby1.9.3\lib\ruby\gems\1.9.1\gems\mysql2-0.3.15\ext\mysql2/result.c:76: undefined reference `mysql_free_result@4' collect2: ld returned 1 exit status make: *** [mysql2.so] error 1   gem files remain installed in c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15 inspection. results logged c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15/ext/mysql2/gem_make.out  d:\projects\ruby\cms> 

you need use the 32-bit version of mysql connector (i think you're using 64-bit)

mysql2 pain install on windows, it's because dependencies & libraries requires not installed natively. you're there mysql c-connector, you'll have uninstall & download 32 bit version


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -