mac book pro 2017 で homebrew から ruby や ruby-env をインストールして Rails の環境を作ったのですが
gem 'mysql2' ~> 0.3.20
bundle install で mysql のところでエラーが出ます
軽く検索したら ssl 関連のエラーらしくて
xcode-select --install
を実行するだけでうまくいったというブログがいくつもでてくるのですが
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
というエラーが出てうまくいきません
xcode-select のエラーに関しても検索するといろいろ記事がでてくるんですがそのうち次の2つ試しましたが何もかわりませんでした
App Store から XCode 最新版をいれてみても何かプロジェクトを作るみたいなGUIの窓がでるだけで
xcode-select --install はあいかわらずエラーが出ます
あと手動で command line tool を Appple developper からインストールするみたいな記事もあったのでやってみましたが
xcode-select --install も bundle-install も何もかわりません
OS は macOS High Sierra 10.13.6 です
よろしくおねがいします
追記: エラーログ
Installing mysql2 0.3.20 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /Users/assist1/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20180914-31937-1ra6qbf.rb extconf.rb checking for ruby/thread.h... yes checking for rb_thread_call_without_gvl() in ruby/thread.h... yes checking for rb_thread_blocking_region()... no checking for rb_wait_for_single_fd()... yes checking for rb_hash_dup()... yes checking for rb_intern3()... yes ----- Using mysql_config at /Users/assist1/local/homebrew/bin/mysql_config ----- checking for mysql.h... yes checking for errmsg.h... yes checking for mysqld_error.h... yes ----- Setting rpath to /Users/assist1/local/homebrew/Cellar/mysql/8.0.11/lib ----- creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling infile.c compiling client.c client.c:439:3: error: use of undeclared identifier 'my_bool' my_bool res = mysql_read_query_result(client); ^ client.c:441:19: error: use of undeclared identifier 'res' return (void *)(res == 0 ? Qtrue : Qfalse); ^ client.c:775:3: error: use of undeclared identifier 'my_bool' my_bool boolval; ^ client.c:806:7: error: use of undeclared identifier 'boolval' boolval = (value == Qfalse ? 0 : 1); ^ client.c:807:17: error: use of undeclared identifier 'boolval' retval = &boolval; ^ client.c:810:10: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'; did you mean 'MYSQL_DEFAULT_AUTH'? case MYSQL_SECURE_AUTH: ^~~~~~~~~~~~~~~~~ MYSQL_DEFAULT_AUTH /Users/assist1/local/homebrew/Cellar/mysql/8.0.11/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here MYSQL_DEFAULT_AUTH, ^ client.c:811:7: error: use of undeclared identifier 'boolval' boolval = (value == Qfalse ? 0 : 1); ^ client.c:812:17: error: use of undeclared identifier 'boolval' retval = &boolval; ^ client.c:843:38: error: use of undeclared identifier 'boolval' wrapper->reconnect_enabled = boolval; ^ client.c:1198:38: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'; did you mean 'MYSQL_DEFAULT_AUTH'? return _mysql_client_options(self, MYSQL_SECURE_AUTH, value); ^~~~~~~~~~~~~~~~~ MYSQL_DEFAULT_AUTH /Users/assist1/local/homebrew/Cellar/mysql/8.0.11/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here MYSQL_DEFAULT_AUTH, ^ 10 errors generated. make: *** [client.o] Error 1 make failed, exit code 2
回答3件
あなたの回答
tips
プレビュー