{"id":9606,"date":"2019-05-05T01:59:43","date_gmt":"2019-05-04T16:59:43","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=9606"},"modified":"2019-05-05T01:59:43","modified_gmt":"2019-05-04T16:59:43","slug":"rails5-gem%e3%81%a7mysql2%e3%81%8c-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%a7%e3%81%8d%e3%81%aa%e3%81%84","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=9606","title":{"rendered":"Rails5 gem\u3067mysql2\u304c \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u306a\u3044"},"content":{"rendered":"<p>Rails5\u3067\u3001mysql2\u306egem\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3001Gem\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u8a18\u3057\u3001<\/p>\n<p>bundle\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001\u30a8\u30e9\u30fc\u3067\u30b3\u30b1\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">inking shared-object mysql2\/mysql2.bundle\r\nld: library not found for -lssl\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\nmake: *** &#x5B;mysql2.bundle] Error 1\r\n\r\n\r\nAn error occurred while installing mysql2 (0.5.2), and Bundler cannot\r\ncontinue.\r\nMake sure that `gem install mysql2 -v '0.5.2' --source 'https:\/\/rubygems.org\/'`\r\nsucceeds before bundling.<\/pre>\n<p>\u3046\u3093\uff1f\u306a\u3093\u3060\u3053\u308c\u3002<\/p>\n<p>\u30a8\u30e9\u30fc\u3067\u8868\u793a\u3057\u3066\u3044\u308b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u8a66\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ gem install mysql2 -v '0.5.2' --source 'https:\/\/rubygems.org\/\u2018<\/pre>\n<p>\u72b6\u6cc1\u306f\u5909\u308f\u3089\u305a\u3002<\/p>\n<p>\u3046\u3093\uff1f\u306a\u3093\u3060\u3053\u308c\u3002<\/p>\n<p>\u30cd\u30c3\u30c8\u4e0a\u3067\u306f\u3001xcode\u304c\u539f\u56e0\u3060\u3063\u305f\u308a\u3001\u6a29\u9650\u304c\u554f\u984c\u3060\u3063\u305f\u308a\u3068\u4e0a\u304c\u3063\u3066\u3044\u307e\u3057\u3066\u8a66\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ xcode-select \u2014install<\/pre>\n<p>\u3053\u3061\u3089\u3082\u8a66\u3059\u304c\u72b6\u6cc1\u5909\u308f\u3089\u305a\u3002<\/p>\n<p>\u3067\u3001\u7d50\u5c40\u539f\u56e0\u306f<\/p>\n<li>&#8211;with-cppflags<\/li>\n<li>&#8211;with-ldflags<\/li>\n<p>\u3053\u3061\u3089\u306e\u6307\u5b9a\u3092\u3059\u308c\u3070\u89e3\u6c7a\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>Rails\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4ee5\u4e0b\u3092\u5b9f\u884c\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ bundle config --local build.mysql2 \"--with-cppflags=-I\/usr\/local\/opt\/openssl\/include\"\r\n$ bundle config --local build.mysql2 \"--with-ldflags=-L\/usr\/local\/opt\/openssl\/lib\"<\/pre>\n<p>\u3059\u308b\u3068\u3001.bundle\/config\u306b\uff08\u306a\u3051\u308c\u3070\u751f\u6210\u3055\u308c\u308b\uff09\u4ee5\u4e0b\u304c\u8ffd\u8a18\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">BUNDLE_BUILD__MYSQL2: \"--with-ldflags=-L\/usr\/local\/opt\/openssl\/lib\"<\/pre>\n<p>\u518d\u5ea6\u3001bundle install<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ bundle install<\/pre>\n<p>\u7121\u4e8b\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rails5\u3067\u3001mysql2\u306egem\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3001Gem\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u8a18\u3057\u3001 bundle\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001\u30a8\u30e9\u30fc\u3067\u30b3\u30b1\u308b\u3002 inking shared-object mysql2\/mysql2.bundle l [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[155],"tags":[],"class_list":["post-9606","post","type-post","status-publish","format-standard","hentry","category-ruby"],"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9606"}],"version-history":[{"count":1,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9606\/revisions"}],"predecessor-version":[{"id":9607,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9606\/revisions\/9607"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}