{"id":2309,"date":"2015-08-14T12:19:06","date_gmt":"2015-08-14T03:19:06","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=2309"},"modified":"2015-08-14T12:32:45","modified_gmt":"2015-08-14T03:32:45","slug":"gem-install-mysql2-%e3%81%ae%e3%82%a8%e3%83%a9%e3%83%bc","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=2309","title":{"rendered":"gem install mysql2 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30a8\u30e9\u30fc"},"content":{"rendered":"<p><strong>\u5bfe\u8c61\u74b0\u5883<\/strong><\/p>\n<ul>\n<li>CentOS 6.7<\/li>\n<li>Ruby2.1<\/li>\n<li>Rails4.1<\/li>\n<li>MySQL Community Server 5.6.26<\/li>\n<\/ul>\n<p><strong>\u6982\u8981<\/strong><\/p>\n<p>Redmine\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001MySQL\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001Rails\u3067\u4f7f\u7528\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30eamysql2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u30a8\u30e9\u30fc\u3068\u306a\u308b\u3002<\/p>\n<p>[bash]<br \/>\n$ gem install mysql2 -v &#8216;0.3.19&#8217;<br \/>\nFetching: mysql2-0.3.19.gem (100%)<br \/>\nBuilding native extensions.  This could take a while&#8230;<br \/>\nERROR:  Error installing mysql2:<br \/>\n        ERROR: Failed to build gem native extension.<\/p>\n<p>    \/usr\/local\/ruby2.2\/bin\/ruby -r .\/siteconf20150814-32250-1l3iwxf.rb extconf.rb<br \/>\nchecking for ruby\/thread.h&#8230; yes<br \/>\nchecking for rb_thread_call_without_gvl() in ruby\/thread.h&#8230; yes<br \/>\nchecking for rb_thread_blocking_region()&#8230; no<br \/>\nchecking for rb_wait_for_single_fd()&#8230; yes<br \/>\nchecking for rb_hash_dup()&#8230; yes<br \/>\nchecking for rb_intern3()&#8230; yes<br \/>\n&#8212;&#8211;<br \/>\nUsing mysql_config at \/usr\/bin\/mysql_config<br \/>\n&#8212;&#8211;<br \/>\nchecking for mysql.h&#8230; no<br \/>\nchecking for mysql\/mysql.h&#8230; no<br \/>\n&#8212;&#8211;<br \/>\nmysql.h is missing. Try &#8216;apt-get install libmysqlclient-dev&#8217; or<br \/>\n&#8216;yum install mysql-devel&#8217;, check your installation of mysql and try again.<br \/>\n&#8212;&#8211;<br \/>\n*** extconf.rb failed ***<br \/>\nCould not create Makefile due to some reason, probably lack of necessary<br \/>\nlibraries and\/or headers.  Check the mkmf.log file for more details.  You may<br \/>\nneed configuration options.<\/p>\n<p>Provided configuration options:<br \/>\n        &#8211;with-opt-dir<br \/>\n        &#8211;without-opt-dir<br \/>\n        &#8211;with-opt-include<br \/>\n        &#8211;without-opt-include=${opt-dir}\/include<br \/>\n        &#8211;with-opt-lib<br \/>\n        &#8211;without-opt-lib=${opt-dir}\/lib<br \/>\n        &#8211;with-make-prog<br \/>\n        &#8211;without-make-prog<br \/>\n        &#8211;srcdir=.<br \/>\n        &#8211;curdir<br \/>\n        &#8211;ruby=\/usr\/local\/ruby2.2\/bin\/$(RUBY_BASE_NAME)<br \/>\n        &#8211;with-mysql-dir<br \/>\n        &#8211;without-mysql-dir<br \/>\n        &#8211;with-mysql-include<br \/>\n        &#8211;without-mysql-include=${mysql-dir}\/include<br \/>\n        &#8211;with-mysql-lib<br \/>\n        &#8211;without-mysql-lib=${mysql-dir}\/lib<br \/>\n        &#8211;with-mysql-config<br \/>\n        &#8211;without-mysql-config<\/p>\n<p>extconf failed, exit code 1<br \/>\n[\/bash]<\/p>\n<p>Windows\u74b0\u5883\u3067\u30cf\u30de\u3063\u305f\u6642\u306e\u5bfe\u5fdc\u65b9\u6cd5\u306f\u3001<a href=\"https:\/\/www.blowfish.co.jp\/?p=1952\" target=\"_blank\">\u3053\u306e\u8a18\u4e8b<\/a>\u3067\u3042\u308b\u304c\u3001\u4eca\u56de\u306e\u74b0\u5883\u306f\u307e\u305f\u7570\u306a\u308b\u3057\u3001\u5bfe\u5fdc\u65b9\u6cd5\u304c\u7570\u306a\u308b\u3088\u3046\u3060\u3002<\/p>\n<p>\u305d\u3053\u3067\u4e0b\u8a18`mysql-devel`\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<p>[bash]<br \/>\n$ yum install mysql-devel<br \/>\n\u8aad\u307f\u8fbc\u3093\u3060\u30d7\u30e9\u30b0\u30a4\u30f3:fastestmirror, security<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51e6\u7406\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u3044\u307e\u3059<br \/>\nLoading mirror speeds from cached hostfile<br \/>\n * base: ftp.iij.ad.jp<br \/>\n * extras: ftp.iij.ad.jp<br \/>\n * updates: centos.usonyx.net<br \/>\n\u30d1\u30c3\u30b1\u30fc\u30b8 mysql-devel \u306f mysql-community-devel \u306b\u3088\u3063\u3066\u4e0d\u8981\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u4ee3\u308f\u308a\u306b mysql-community-devel-5.6.26-2.el6.x86_64 \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u8a66\u307f\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4f9d\u5b58\u6027\u306e\u89e3\u6c7a\u3092\u3057\u3066\u3044\u307e\u3059<br \/>\n&#8211;&gt; \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u78ba\u8a8d\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n&#8212;&gt; Package mysql-community-devel.x86_64 0:5.6.26-2.el6 will be \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n&#8211;&gt; \u4f9d\u5b58\u6027\u89e3\u6c7a\u3092\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4f9d\u5b58\u6027\u3092\u89e3\u6c7a\u3057\u307e\u3057\u305f<\/p>\n<p>====================================================================================================<br \/>\n \u30d1\u30c3\u30b1\u30fc\u30b8                    \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3 \u30d0\u30fc\u30b8\u30e7\u30f3            \u30ea\u30dd\u30b8\u30c8\u30ea\u30fc               \u5bb9\u91cf<br \/>\n====================================================================================================<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u307e\u3059:<br \/>\n mysql-community-devel         x86_64         5.6.26-2.el6          mysql56-community         3.2 M<\/p>\n<p>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u8981\u7d04<br \/>\n====================================================================================================<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb         1 \u30d1\u30c3\u30b1\u30fc\u30b8<\/p>\n<p>\u7dcf\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u5bb9\u91cf: 3.2 M<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u5bb9\u91cf: 20 M<br \/>\n\u3053\u308c\u3067\u3044\u3044\u3067\u3059\u304b? [y\/N]y<br \/>\n\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059:<br \/>\nmysql-community-devel-5.6.26-2.el6.x86_64.rpm                                | 3.2 MB     00:01<br \/>\nrpm_check_debug \u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059<br \/>\n\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059<br \/>\n\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30c6\u30b9\u30c8\u3092\u6210\u529f\u3057\u307e\u3057\u305f<br \/>\n\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059<br \/>\n  \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u307e\u3059  : mysql-community-devel-5.6.26-2.el6.x86_64                           1\/1<br \/>\n  Verifying               : mysql-community-devel-5.6.26-2.el6.x86_64                           1\/1<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb:<br \/>\n  mysql-community-devel.x86_64 0:5.6.26-2.el6<\/p>\n<p>\u5b8c\u4e86\u3057\u307e\u3057\u305f!<br \/>\n[\/bash]<\/p>\n<p>\u518d\u5ea6\u3001\u8a66\u3057\u305f\u3089\u4e0a\u624b\u304f\u884c\u3063\u305f\u3002<\/p>\n<p>[bash]<br \/>\n$ gem install mysql2<br \/>\nBuilding native extensions.  This could take a while&#8230;<br \/>\nSuccessfully installed mysql2-0.3.19<br \/>\nParsing documentation for mysql2-0.3.19<br \/>\nInstalling ri documentation for mysql2-0.3.19<br \/>\nDone installing documentation for mysql2 after 1 seconds<br \/>\n1 gem installed<br \/>\n[\/bash]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bfe\u8c61\u74b0\u5883 CentOS 6.7 Ruby2.1 Rails4.1 MySQL Community Server 5.6.26 \u6982\u8981 Redmine\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001MySQL\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001Rails\u3067\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[5,25,14,4],"tags":[],"class_list":["post-2309","post","type-post","status-publish","format-standard","hentry","category-centos","category-rails","category-ruby","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2309"}],"version-history":[{"count":7,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2309\/revisions"}],"predecessor-version":[{"id":2316,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2309\/revisions\/2316"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}