質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

794閲覧

bundle installが上手くいかない

ren0826nosuke

総合スコア34

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2020/08/24 10:01

今回やりたいこと

「bundle install --path vendor/bundle」を実行して成功させたい。

##現状
「bundle install --path vendor/bundle」を実行した際に、下記のエラー発生。

##エラー文

Warning: the running version of Bundler (1.16.1) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. Fetching gem metadata from https://rubygems.org/......... Using rake 12.3.3 〜中略〜 Using listen 3.1.5 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: /home/ren0826nosuke/rennosuke.mihara/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/ext/mysql2 /home/ren0826nosuke/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20200824-2237-176unfi.rb extconf.rb --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for rb_wait_for_single_fd()... yes checking for -lmysqlclient... no ----- mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', 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=/home/ren0826nosuke/.rbenv/versions/2.5.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: /home/ren0826nosuke/rennosuke.mihara/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.5.2/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/ren0826nosuke/rennosuke.mihara/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2 for inspection. Results logged to /home/ren0826nosuke/rennosuke.mihara/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/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'` succeeds before bundling. In Gemfile: mysql2

##試したこと
・gem install mysql2 -v '0.5.2'を実行
→エラー
https://qiita.com/HrsUed/items/ca2e0aee6a2402571cf6#%E5%AF%BE%E5%BF%9C%E7%AD%96
→効果なし
https://pigmon.io/crying-mysql/
→効果なし

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

asm

2020/08/24 10:15

OSは何でしょうか?
asm

2020/08/25 01:16

ログに出てるディレクトリの場所見る限りmacっぽくないですがhomeディレクトリ作ったのでしょうか? それとも仮想環境・リモート環境ですか?
guest

回答1

0

ベストアンサー

mysqlのライブラリ群はインストールされてますか?ログを見る限り、gemのビルドに必要なmysqlのライブラリを見つけられていないようなです。

もしmysqlライブラリをインストール済みであれば、(mysqlコマンドが使えればインストールされているかと。)

bash

1bundle config build.mysql2 --with-mysql-dir=/usr/lib64/mysql

などどとライブラリの場所をbundlerに設定した上で試してみてください。私の環境では、/usr/lib64/mysqlにライブラリがありました。

未インストールなら、インストールが必要です。質問者さんの環境が不明なので違うかもしれませんが、ログにあるようにapt-get install libmysqlclient-devとでもすればインストールできると思います。

投稿2020/08/24 10:23

s_eric

総合スコア184

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問