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

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

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

Unicornは、汎用のRackアプリケーションサーバ。RackとWebサーバーの機能を併せ持ちます。レスポンス処理や、Nginx単体がRackの機能をサポートしていない事から、一般的にはNginx+Unicorn+Railsの構成を取って用います。

MySQL

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

Ruby on Rails

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

VPS

VPS(バーチャル・プライベート・サーバ)は、仮想化されたサーバをレンタルするサービスで、共有サーバでありながら専門サーバと同等の機能を果たします。物理的な専門サーバより安価で提供できるメリットがあります。

Capistrano

Rubyで書かれたサーバオーケストレーションで、複数のサーバでスクリプトを実行する際に用いられます。主な使用用途はWebアプリケーションのデプロイメントです。 アプリケーションのバージョンアップ自動化、およびデータベースの変更などもできます。

Q&A

1回答

2127閲覧

デプロイ時にmysql2のインストールができない

Naoto1

総合スコア12

unicorn

Unicornは、汎用のRackアプリケーションサーバ。RackとWebサーバーの機能を併せ持ちます。レスポンス処理や、Nginx単体がRackの機能をサポートしていない事から、一般的にはNginx+Unicorn+Railsの構成を取って用います。

MySQL

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

Ruby on Rails

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

VPS

VPS(バーチャル・プライベート・サーバ)は、仮想化されたサーバをレンタルするサービスで、共有サーバでありながら専門サーバと同等の機能を果たします。物理的な専門サーバより安価で提供できるメリットがあります。

Capistrano

Rubyで書かれたサーバオーケストレーションで、複数のサーバでスクリプトを実行する際に用いられます。主な使用用途はWebアプリケーションのデプロイメントです。 アプリケーションのバージョンアップ自動化、およびデータベースの変更などもできます。

0グッド

0クリップ

投稿2021/04/07 08:51

編集2021/04/07 08:52

前提・実現したいこと

ここに質問の内容を詳しく書いてください。
RailsアプリをVPS(Conoha)で動かすことを目的としています。
デプロイ時にmysql2のインストールの際エラーが出ています。

発生している問題・エラーメッセージ

To see why this extension failed to compile, please check the mkmf.log which can be found here: /var/www/portfolio/shared/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mysql2-0.5.3/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /var/www/portfolio/shared/bundle/ruby/3.0.0/gems/mysql2-0.5.3 for inspection. Results logged to /var/www/portfolio/shared/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/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 bundle stderr: Nothing written ** DEPLOY FAILED ** Refer to log/capistrano.log for details. Here are the last 20 lines: To see why this extension failed to compile, please check the mkmf.log which can be found here: /var/www/portfolio/shared/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mysql2-0.5.3/mkmf.log

該当のソースコード

bundle exec cap production deploy  上記コマンドでデプロイ実行しています。

試したこと

①エラ〜メッセージ通り、gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'
を実行してbundle installしましたが改善されませんでした。
②bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib"
コマンドを打ち、bundle installしましたが効果なしでした。
③またGemfileに直接バージョン指定して同じくbundle installしましたが、こちらも効果なしでした。

補足情報(FW/ツールのバージョンなど)

何か不足情報ありましたらご教授ください。
何卒宜しくお願いします。

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

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

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

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

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

guest

回答1

0

多分なにかfileが足りないのです。
エラーメッセージに To see why this extension failed to compile, please check the mkmf.log 
と有るように、そこを読んでください。
何が原因なのかが書かれています。多分どうすればよいかも書かれています。

投稿2021/04/07 11:40

winterboum

総合スコア23347

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

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

Naoto1

2021/04/07 12:40

ありがとうございます。 エラーの読み方に慣れておらず、大変助かりました。 一度見てみます!
Naoto1

2021/04/07 12:59

catコマンドを使用してエラーログを表示させてみました。 ‘rb_wait_for_single_fd’ が宣言されていないなどのエラーが出ていたので 調べてみたのですが、理解が乏しく解決には至りませんでした。 知見を貸して頂けると幸甚です。 "gcc -std=gnu99 -o conftest -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/home/localadmin/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L/home/localadmin/.rbenv/versions/3.0.0/lib -lruby -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return !!argv[argc]; 6: } /* end */ "gcc -std=gnu99 -o conftest -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/home/localadmin/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L/home/localadmin/.rbenv/versions/3.0.0/lib -lruby -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: int (* volatile tp)(void)=(int (*)(void))&t; 9: printf("%d", (*tp)()); 10: } 11: 12: return !!argv[argc]; 13: } 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_absint_size; return !p; } /* end */ -------------------- have_func: checking for rb_absint_singlebit_p()... -------------------- yes "gcc -std=gnu99 -o conftest -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/home/localadmin/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L/home/localadmin/.rbenv/versions/3.0.0/lib -lruby -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: int (* volatile tp)(void)=(int (*)(void))&t; 9: printf("%d", (*tp)()); 10: } 11: 12: return !!argv[argc]; 13: } 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_absint_singlebit_p; return !p; } /* end */ -------------------- have_func: checking for rb_wait_for_single_fd()... -------------------- yes "gcc -std=gnu99 -o conftest -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/home/localadmin/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L/home/localadmin/.rbenv/versions/3.0.0/lib -lruby -lm -lc" conftest.c: 関数 ‘t’ 内: conftest.c:14:57: エラー: ‘rb_wait_for_single_fd’ が宣言されていません (この関数内での最初の使用) int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_wait_for_single_fd; return !p; } ^ conftest.c:14:57: 備考: 未宣言の識別子は出現した各関数内で一回のみ報告されます conftest.c: トップレベル: cc1: 警告: 認識できないコマンドラインオプション "-Wno-tautological-compare" です [デフォルトで有効] cc1: 警告: 認識できないコマンドラインオプション "-Wno-self-assign" です [デフォルトで有効] cc1: 警告: 認識できないコマンドラインオプション "-Wno-parentheses-equality" です [デフォルトで有効] cc1: 警告: 認識できないコマンドラインオプション "-Wno-constant-logical-operand" です [デフォルトで有効] cc1: 警告: 認識できないコマンドラインオプション "-Wno-cast-function-type" です [デフォルトで有効] checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: int (* volatile tp)(void)=(int (*)(void))&t; 9: printf("%d", (*tp)()); 10: } 11: 12: return !!argv[argc]; 13: } 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_wait_for_single_fd; return !p; } /* end */ "gcc -std=gnu99 -o conftest -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/x86_64-linux -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/backward -I/home/localadmin/.rbenv/versions/3.0.0/include/ruby-3.0.0 -I. -I/home/localadmin/.rbenv/versions/3.0.0/include -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L. -L/home/localadmin/.rbenv/versions/3.0.0/lib -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/localadmin/.rbenv/versions/3.0.0/lib -L/home/localadmin/.rbenv/versions/3.0.0/lib -lruby -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: int (* volatile tp)(void)=(int (*)(void))&t; 9: printf("%d", (*tp)()); 10: } 11: 12: return !!argv[argc]; 13: } 14: extern void rb_wait_for_single_fd(); 15: int t(void) { rb_wait_for_single_fd(); return 0; } /* end */
winterboum

2021/04/07 14:56

これがlogの最後ですか?
Naoto1

2021/04/07 23:25

上記がlogの最後になります。 他にcapistranoのエラーも出ておりましたのでログを取ってみました。 DEBUG [81de31f3] The following gems are missing * mysql2 (0.5.3) Install missing gems with `bundle install` DEBUG [81de31f3] Finished in 0.467 seconds with exit status 1 (failed). INFO [7ba341f1] Running RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle install --jobs 4 --quiet as localadmin@118.27.9.129 DEBUG [7ba341f1] Command: cd /var/www/portfolio/releases/20210407142316 && ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" ; RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle install --jobs 4 --quiet ) DEBUG [7ba341f1] Gem::Ext::BuildError: ERROR: Failed to build gem native extension. mysql2はインストール済み(0.5.3)及び、Gemも重複していないのですが 同じログが表示され続けている状態です。。。
winterboum

2021/04/07 23:36

mysql2 のいんsトールが成功していないんだと思いますよ。 mkmf.log の全体ではなく、最後が重要です。そこは上のlogにでてますか?
Naoto1

2021/04/08 01:36

ご回答ありがとうございます。 すみません。全文送ってませんでした。 DEBUG [e48c1917] Command: cd /var/www/portfolio/releases/20210407233743 && ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" ; RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle config --local path /var/www/portfolio/shared/bundle ) INFO [e48c1917] Finished in 0.358 seconds with exit status 0 (successful). INFO [57e84a1a] Running RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle config --local without development:test as localadmin@118.27.9.129 DEBUG [57e84a1a] Command: cd /var/www/portfolio/releases/20210407233743 && ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" ; RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle config --local without development:test ) INFO [57e84a1a] Finished in 0.364 seconds with exit status 0 (successful). DEBUG [f5bc21e8] Running if test ! -d /var/www/portfolio/releases/20210407233743; then echo "Directory does not exist '/var/www/portfolio/releases/20210407233743'" 1>&2; false; fi as localadmin@118.27.9.129 DEBUG [f5bc21e8] Command: if test ! -d /var/www/portfolio/releases/20210407233743; then echo "Directory does not exist '/var/www/portfolio/releases/20210407233743'" 1>&2; false; fi DEBUG [f5bc21e8] Finished in 0.103 seconds with exit status 0 (successful). DEBUG [d5d3dfdc] Running RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle check as localadmin@118.27.9.129 DEBUG [d5d3dfdc] Command: cd /var/www/portfolio/releases/20210407233743 && ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" ; RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle check ) DEBUG [d5d3dfdc] The following gems are missing * mysql2 (0.5.3) Install missing gems with `bundle install` DEBUG [d5d3dfdc] Finished in 0.607 seconds with exit status 1 (failed). INFO [e57b422c] Running RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle install --jobs 4 --quiet as localadmin@118.27.9.129 DEBUG [e57b422c] Command: cd /var/www/portfolio/releases/20210407233743 && ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" ; RBENV_ROOT=/home/localadmin/.rbenv RBENV_VERSION=3.0.0 /home/localadmin/.rbenv/bin/rbenv exec bundle install --jobs 4 --quiet ) DEBUG [e57b422c] Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /var/www/portfolio/shared/bundle/ruby/3.0.0/gems/mysql2-0.5.3/ext/mysql2 /home/localadmin/.rbenv/versions/3.0.0/bin/ruby -I /home/localadmin/.rbenv/versions/3.0.0/lib/ruby/site_ruby/3.0.0 -r ./siteconf20210408-27879-bposbq.rb extconf.rb --with-ldflags\=-L/usr/local/opt/openssl/lib checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for rb_wait_for_single_fd()... yes *** 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/localadmin/.rbenv/versions/3.0.0/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-mysqlclient-dir --without-mysqlclient-dir --with-mysqlclient-include --without-mysqlclient-include=${mysqlclient-dir}/include --with-mysqlclient-lib --without-mysqlclient-lib=${mysqlclient-dir}/lib --with-mysqlclientlib --without-mysqlclientlib /home/localadmin/.rbenv/versions/3.0.0/lib/ruby/3.0.0/mkmf.rb:1050:in `block in find_library': undefined method `split' for nil:NilClass (NoMethodError) from /home/localadmin/.rbenv/versions/3.0.0/lib/ruby/3.0.0/mkmf.rb:1050:in `collect' from /home/localadmin/.rbenv/versions/3.0.0/lib/ruby/3.0.0/mkmf.rb:1050:in `find_library' from extconf.rb:87:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /var/www/portfolio/shared/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mysql2-0.5.3/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /var/www/portfolio/shared/bundle/ruby/3.0.0/gems/mysql2-0.5.3 for inspection. Results logged to /var/www/portfolio/shared/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/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 INFO --------------------------------------------------------------------------- INFO START 2021-04-08 10:33:16 +0900 cap production deploy INFO --------------------------------------------------------------------------- DEBUG [b957f79a] Running [ -d /home/localadmin/.rbenv/versions/3.0.0 ] as localadmin@118.27.9.129 DEBUG [b957f79a] Command: [ -d /home/localadmin/.rbenv/versions/3.0.0 ] DEBUG [b957f79a] Finished in 0.725 seconds with exit status 0 (successful). INFO [f46ece30] Running /usr/bin/env mkdir -p /tmp as localadmin@118.27.9.129 DEBUG [f46ece30] Command: ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" ; /usr/bin/env mkdir -p /tmp ) INFO [f46ece30] Finished in 0.097 seconds with exit status 0 (successful). DEBUG Uploading /tmp/git-ssh-d9323b3d44e8d70692e2.sh 0.0% INFO Uploading /tmp/git-ssh-d9323b3d44e8d70692e2.sh 100.0% INFO [8ec512c9] Running /usr/bin/env chmod 700 /tmp/git-ssh-d9323b3d44e8d70692e2.sh as localadmin@118.27.9.129 DEBUG [8ec512c9] Command: ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" ; /usr/bin/env chmod 700 /tmp/git-ssh-d9323b3d44e8d70692e2.sh ) INFO [8ec512c9] Finished in 0.100 seconds with exit status 0 (successful). INFO [b7456ee1] Running /usr/bin/env git ls-remote git@github.com:Naoto3615/portfolio.git HEAD as localadmin@118.27.9.129 DEBUG [b7456ee1] Command: ( export RBENV_ROOT="/home/localadmin/.rbenv" RBENV_VERSION="3.0.0" GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-d9323b3d44e8d70692e2.sh" ; /usr/bin/env git ls-remote git@github.com:Naoto3615/portfolio.git HEAD ) DEBUG [b7456ee1] Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 長文で申し訳ないです。 もう一度mysql2のインストールをし直してみます。
Naoto1

2021/04/08 02:41

gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/' -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib 上記コマンドを打ちました。 →→結果 Building native extensions with: '--with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib' This could take a while... Successfully installed mysql2-0.5.3 Parsing documentation for mysql2-0.5.3 Done installing documentation for mysql2 after 0 seconds 1 gem installed インストールはされたような記述が書かれているのですが、デプロイ時には 同じエラーが出現しました。 解決策が見い出せず悩み中です。。。。
winterboum

2021/04/08 05:22

すると、インストール場所が違うのかな。 bundle install ではシステムエリア にいれてます? それとも Rails.root のvender とかに入れてます?
Naoto1

2021/04/08 05:33 編集

ご回答ありがとうございます。 bundle instal はシステムに入ってました。
Naoto1

2021/04/08 05:51

bundle installすると Using mysql2 0.5.3の表示があるので インストールはされているようですが、場所がどこに配置すれば良いのかが謎です。。。
winterboum

2021/04/08 08:20

質問の最初は mysql2がインストール出来ない、ということでした 次のcapstroのlogでは Permission denied (publickey). fatal: Could not read from remote repository. となっています。 最後は「インストールはされたような記述が書かれているのですが、デプロイ時には 同じエラーが出現しました。」 とあります。 時系列があるので状況がはっきりしません。 現在の状態ではどうなるのでしょう。 何が通り、何が通らないのか。
Naoto1

2021/04/08 09:08

時系列が逆になってしまって申し訳ないです。 現在は、permissionエラーは解決しました。 mysqlのエラーのみ残っている状況です。 分かりづらい説明になってしまいました。
winterboum

2021/04/08 13:13

mysqlのエラー とは?
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問