前提・実現したいこと
ここに質問の内容を詳しく書いてください。
データベースの作成、README.mdにモデルを記述し、htmlファイルをlocalhost300で確認するために
「rail s」 と入力,その後エラーが発生し
Run bundle install
to install missing gems.と出たため
bundle install したのですがこのようにエラーが出ました。
bundle installできるようにしたいです。
発生している問題・エラーメッセージ
エラーメッセージ An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling.
該当のソースコード
ソースコード The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. Fetching gem metadata from https://rubygems.org/............ Using rake 12.3.2 Using concurrent-ruby 1.1.5 Using i18n 1.6.0 Using minitest 5.11.3 Using thread_safe 0.3.6 Using tzinfo 1.2.5 Using activesupport 5.0.7.2 Using builder 3.2.3 Using erubis 2.7.0 Using mini_portile2 2.4.0 Using nokogiri 1.10.3 Using rails-dom-testing 2.0.3 Using crass 1.0.4 Using loofah 2.2.3 Using rails-html-sanitizer 1.0.4 Using actionview 5.0.7.2 Using rack 2.0.7 Using rack-test 0.6.3 Using actionpack 5.0.7.2 Using nio4r 2.3.1 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.1 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 bindex 0.7.0 Using bundler 2.0.2 Using byebug 11.0.1 Using coffee-script-source 1.12.2 Using execjs 2.7.0 Using coffee-script 2.4.1 Using method_source 0.9.2 Using thor 0.20.3 Using railties 5.0.7.2 Using coffee-rails 4.2.2 Using ffi 1.11.1 Using temple 0.8.1 Using tilt 2.0.9 Using haml 5.1.1 Using sexp_processor 4.12.1 Using ruby_parser 3.13.1 Using html2haml 2.2.0 Using haml-rails 1.0.0 Using jbuilder 2.9.1 Using jquery-rails 4.3.5 Using rb-fsevent 0.10.3 Using rb-inotify 0.10.0 Using listen 3.0.8 Fetching mysql2 0.5.2 Installing mysql2 0.5.2 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/ /.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mysql2-0.5.2/ext/mysql2 /Users/ /.rbenv/versions/2.6.3/bin/ruby -I /Users/ /.rbenv/versions/2.6.3/lib/ruby/2.6.0 -r ./siteconf20190711-84381-e34gy1.rb extconf.rb checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for rb_wait_for_single_fd()... yes ----- Using mysql_config at /usr/local/opt/mysql@5.6/bin/mysql_config ----- checking for mysql.h... yes checking for errmsg.h... yes checking for SSL_MODE_DISABLED in mysql.h... no checking for MYSQL_OPT_SSL_ENFORCE in mysql.h... no checking for MYSQL.net.vio in mysql.h... yes checking for MYSQL.net.pvio in mysql.h... no checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes checking for my_bool in mysql.h... yes ----- Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load ----- ----- Setting libpath to /usr/local/opt/mysql@5.6/lib ----- creating Makefile current directory: /Users/ /.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mysql2-0.5.2/ext/mysql2 make "DESTDIR=" clean current directory: /Users/ /.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mysql2-0.5.2/ext/mysql2 make "DESTDIR=" compiling client.c compiling infile.c compiling mysql2_ext.c compiling result.c compiling statement.c linking shared-object mysql2/mysql2.bundle ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [mysql2.bundle] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/ /.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mysql2-0.5.2 for inspection. Results logged to /Users/ /.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0-static/mysql2-0.5.2/gem_make.out An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: mysql2
試したこと
Gemfile,database.ymlの記述の確認。
bundle config --local build.mysql2
bundle update 等も試しましたができませんでした。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/12 05:16