qiita
のRailsインストールの部分で詰まっています。
bundle install --path=vendor/bundle
を打つと、
An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.
Make sure thatgem install mysql2 -v ‘0.5.3’ --source ‘https://rubygems.org/’
succeeds before
bundling.
が表示されてしまいます。
などを参考に調べているのですが、解決せず。。
また、
mysql client is missing. You may need to ‘brew install mysql’ or ‘port install mysql’, and try
again.*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
上記のメッセージも出ているので、mkmf.logをみたのですがわからず。。
mysqlは
brew install mysql@5.7
で入れていて、
mysql --version
は
mysql Ver 14.14 Distrib 5.7.29, for osx10.14 (x86_64) using EditLine wrapper
です。
$ bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib"
を打ったあとに、
bundle install
をしてもダメでした。
どうすれば良いか、教えていただけますでしょうか?
お手数お掛けしますが、よろしくおねがい致します。
現状、bundle installを打って出ているメッセージを以下に載せます。
Fetching gem metadata from https://rubygems.org/....... Fetching gem metadata from https://rubygems.org/. Resolving dependencies............................................. Using rake 13.0.1 Using CFPropertyList 2.3.6 Using concurrent-ruby 1.1.6 Using i18n 1.8.2 Using minitest 5.14.0 Using thread_safe 0.3.6 Using tzinfo 1.2.6 Using activesupport 5.0.7.2 Using builder 3.2.4 Using erubis 2.7.0 Using mini_portile2 2.4.0 Using nokogiri 1.10.9 Using rails-dom-testing 2.0.3 Using crass 1.0.6 Using loofah 2.4.0 Using rails-html-sanitizer 1.3.0 Using actionview 5.0.7.2 Using rack 2.2.2 Using rack-test 0.6.3 Using actionpack 5.0.7.2 Using nio4r 2.5.2 Using websocket-extensions 0.1.4 Using websocket-driver 0.6.5 Using actioncable 5.0.7.2 Using globalid 0.4.2 Using activejob 5.0.7.2 Using mini_mime 1.0.2 Using mail 2.7.1 Using actionmailer 5.0.7.2 Using activemodel 5.0.7.2 Using arel 7.1.4 Using activerecord 5.0.7.2 Using multi_json 1.14.1 Using method_source 0.9.2 Using thor 0.20.3 Using railties 5.0.7.2 Using activerecord-session_store 1.1.3 Using public_suffix 4.0.3 Using addressable 2.7.0 Using gyoku 1.3.1 Using akami 1.3.1 Using ast 2.4.0 Using parser 2.7.0.4 Using astrolabe 1.3.1 Using execjs 2.7.0 Using autoprefixer-rails 8.6.5 Using awesome_print 1.8.0 Using bcrypt 3.1.13 Using coderay 1.1.2 Using erubi 1.9.0 Using better_errors 2.6.0 Using debug_inspector 0.0.3 Using binding_of_caller 0.8.0 Using uniform_notifier 1.13.0 Using bullet 6.1.0 Using bundler 2.1.4 Using byebug 11.0.1 Using cancancan 3.0.2 Using mini_magick 4.10.1 Using ffi 1.12.2 Using ruby-vips 2.0.17 Using image_processing 1.10.3 Using mimemagic 0.3.4 Using carrierwave 2.1.0 Using chartkick 3.3.1 Using multipart-post 2.1.1 Using faraday 0.17.3 Using chatwork 0.4.1 Using chronic 0.10.2 Using orm_adapter 0.5.0 Using ckeditor 5.1.0 Using coffee-script-source 1.12.2 Using coffee-script 2.4.1 Using coffee-rails 4.1.1 Using deep_merge 1.2.1 Using dry-core 0.4.9 Using dry-configurable 0.8.3 Using dry-equalizer 0.2.2 Using dry-logic 0.6.1 Using dry-container 0.7.2 Using dry-inflector 0.1.2 Using dry-types 0.15.0 Using dry-validation 0.13.0 Using config 1.7.2 Using connection_pool 2.2.2 Using cookiejar 0.3.3 Using cropper-rails 2.3.2.1 Using daemons 1.3.1 Using database_cleaner 1.8.3 Using diff-lcs 1.3 Using unf_ext 0.0.7.6 Using unf 0.1.4 Using domain_name 0.5.20190701 Using dotenv 2.7.5 Using dotenv-rails 2.7.5 Using sprockets 3.7.2 Using sprockets-rails 3.2.1 Using rails 5.0.7.2 Using dropzonejs-rails 0.8.4 Using eventmachine 1.2.7 Using em-socksify 0.3.2 Using http_parser.rb 0.6.0 Using em-http-request 1.1.5 Using excon 0.72.0 Using factory_bot 5.1.1 Using factory_bot_rails 5.1.1 Using faker 2.10.2 Using fast-stemmer 1.0.2 Using faye-websocket 0.10.9 Using faye 1.2.4 Using fission 0.5.0 Using formatador 0.2.5 Using fog-core 1.45.0 Using fog-json 1.2.0 Using ipaddress 0.8.3 Using xml-simple 1.1.5 Using fog-aliyun 0.3.6 Using fog-xml 0.1.3 Using fog-atmos 0.1.0 Using fog-aws 2.0.1 Using mime-types-data 3.2019.1009 Using mime-types 3.3.1 Using fog-brightbox 0.16.1 Using fog-cloudatcost 0.1.2 Using fog-digitalocean 0.4.0 Using fog-dnsimple 1.0.0 Using fog-dynect 0.0.3 Using fog-ecloud 0.3.0 Using fog-google 0.1.0 Using fog-internet-archive 0.0.1 Using fog-joyent 0.0.1 Using fog-local 0.6.0 Using fog-openstack 0.3.10 Using fog-powerdns 0.2.0 Using fog-profitbricks 4.1.1 Using fog-rackspace 0.1.6 Using fog-radosgw 0.0.5 Using fog-riakcs 0.1.0 Using fog-sakuracloud 1.7.5 Using fog-serverlove 0.1.2 Using fog-softlayer 1.1.4 Using fog-storm_on_demand 0.1.1 Using fog-terremark 0.1.0 Using fog-vmfusion 0.1.0 Using fog-voxel 0.1.0 Using json 1.8.6 Using optimist 3.0.0 Using rbvmomi 2.3.0 Using fog-vsphere 3.2.5 Using xmlrpc 0.3.0 Using fog-xenserver 1.0.0 Using fog 1.41.0 Using font-awesome-rails 4.7.0.5 Using geokit 1.13.1 Using gmo 0.4.0 Using request_store 1.5.0 Using gon 6.3.2 Using rb-fsevent 0.10.3 Using rb-inotify 0.10.1 Using listen 3.2.1 Using lumberjack 1.2.4 Using nenv 0.3.0 Using shellany 0.0.1 Using notiffany 0.1.3 Using pry 0.12.2 Using guard 2.16.1 Using guard-compat 1.2.1 Using rspec-support 3.9.2 Using rspec-core 3.9.1 Using rspec-expectations 3.9.0 Using rspec-mocks 3.9.1 Using rspec 3.9.0 Using guard-rspec 4.7.3 Using temple 0.8.2 Using tilt 2.0.10 Using haml 5.1.2 Using hashie 4.1.0 Using holiday_jp 0.7.1 Using http-accept 1.7.0 Using http-cookie 1.0.3 Using multi_xml 0.6.0 Using httparty 0.18.0 Using socksify 1.7.1 Using httpi 2.4.4 Using hubspot-ruby 0.9.0 Using jbuilder 2.10.0 Using jquery-rails 4.3.5 Using turbolinks-source 5.2.0 Using turbolinks 5.2.1 Using jquery-turbolinks 2.1.0 Using jquery-ui-rails 6.0.1 Using jwt 2.2.1 Using kaminari-core 1.2.0 Using kaminari-actionview 1.2.0 Using kaminari-activerecord 1.2.0 Using kaminari 1.2.0 Using rjb 1.6.1 Using yajl-ruby 1.4.1 Using kuromoji-ruby 0.0.4 Using libv8 3.16.14.19 (x86_64-darwin-18) Using magnific-popup-rails 1.1.0 Using ruby2_keywords 0.0.2 Using mustermann 1.1.1 Using rack-protection 2.0.8.1 Using sinatra 2.0.8.1 Using thin 1.7.2 Using skinny 0.2.2 Using sqlite3 1.4.2 Using sqlite3-ruby 1.3.3 Using mailcatcher 0.2.4 Using meta-tags 2.13.0 Fetching mysql2 0.5.3 Installing mysql2 0.5.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/user/workspace/kbr_server/vendor/bundler/ruby/2.3.0/gems/mysql2-0.5.3/ext/mysql2 /Users/user/.rbenv/versions/2.3.1/bin/ruby -I /Users/user/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0 -r ./siteconf20200311-58269-p2qkug.rb extconf.rb --with-ldflags\=-L/usr/local/opt/openssl@1.1/lib checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for rb_wait_for_single_fd()... yes checking for main() in -lmysqlclient... no ----- mysql client is missing. You may need to 'brew install mysql' or 'port install mysql', and try again. ----- *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/user/.rbenv/versions/2.3.1/bin/$(RUBY_BASE_NAME) --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/user/workspace/kbr_server/vendor/bundler/ruby/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/mysql2-0.5.3/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Users/user/workspace/kbr_server/vendor/bundler/ruby/2.3.0/gems/mysql2-0.5.3 for inspection. Results logged to /Users/user/workspace/kbr_server/vendor/bundler/ruby/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/mysql2-0.5.3/gem_make.out An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: mysql2
