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

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

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

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

Q&A

1回答

360閲覧

Herokuのステージング環境で発生するエラーを解決したい(Railsアプリ)

退会済みユーザー

退会済みユーザー

総合スコア0

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

0グッド

0クリップ

投稿2018/01/24 04:45

編集2022/01/12 10:55

ruby on railsを使ったアプリケーションをつくり、Herokuに本番環境とステージング環境をつくりました。

本番環境は表示されるのですが、ステージング環境だけ下記のエラーで表示がされません。

We're sorry, but something went wrong. If you are the application owner check the logs for more information.

heroku db:migrateは試しましたが、変化はありませんでした。

おわかりでしたらご教示いただけますと幸いです。よろしくお願い致します。

追記コード config/database.yml

production: adapter: mysql2 encoding: utf8 database: mooovi_production pool: 5 username: root password: socket: /tmp/mysql.sock

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

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

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

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

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

Udomomo

2018/01/24 04:56

heroku logsコマンドで何かエラーは出ていますか?
mtdsnsk

2018/01/24 12:07

dbの設定ファイルはどうなっていますか?
退会済みユーザー

退会済みユーザー

2018/01/27 00:37

2018-01-27T00:29:38.048079+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection' 2018-01-27T00:29:38.048075+00:00 app[web.1]: vendor/ruby-2.3.4/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' 2018-01-27T00:29:38.048077+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection' 2018-01-27T00:29:38.048083+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:87:in `connection' 2018-01-27T00:29:38.048081+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:113:in `retrieve_connection' 2018-01-27T00:29:38.048088+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/query_cache.rb:31:in `call' 2018-01-27T00:29:38.048090+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call' 2018-01-27T00:29:38.048085+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/query_cache.rb:51:in `restore_query_cache_settings' 2018-01-27T00:29:38.048087+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/query_cache.rb:43:in `rescue in call' 2018-01-27T00:29:38.048092+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' 2018-01-27T00:29:38.048093+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:88:in `__run_callbacks__' 2018-01-27T00:29:38.048095+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_call_callbacks' 2018-01-27T00:29:38.048099+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call' 2018-01-27T00:29:38.048097+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks' 2018-01-27T00:29:38.048101+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/remote_ip.rb:78:in `call' 2018-01-27T00:29:38.048102+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' 2018-01-27T00:29:38.048104+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 2018-01-27T00:29:38.048106+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:38:in `call_app' 2018-01-27T00:29:38.048107+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:20:in `block in call' 2018-01-27T00:29:38.048111+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:26:in `tagged' 2018-01-27T00:29:38.048109+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68:in `block in tagged' 2018-01-27T00:29:38.048113+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68:in `tagged' 2018-01-27T00:29:38.048116+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/request_id.rb:21:in `call' 2018-01-27T00:29:38.048125+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/runtime.rb:18:in `call' 2018-01-27T00:29:38.048127+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 2018-01-27T00:29:38.048114+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:20:in `call' 2018-01-27T00:29:38.048123+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/methodoverride.rb:22:in `call' 2018-01-27T00:29:38.048130+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/sendfile.rb:113:in `call' 2018-01-27T00:29:38.048132+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:518:in `call' 2018-01-27T00:29:38.048135+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/lock.rb:17:in `call' 2018-01-27T00:29:38.048129+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/static.rb:116:in `call' 2018-01-27T00:29:38.048134+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call' 2018-01-27T00:29:38.048137+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/content_length.rb:15:in `call' 2018-01-27T00:29:38.048139+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service' 2018-01-27T00:29:38.048142+00:00 app[web.1]: vendor/ruby-2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run' 2018-01-27T00:29:38.048140+00:00 app[web.1]: vendor/ruby-2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service' 2018-01-27T00:29:38.048144+00:00 app[web.1]: vendor/ruby-2.3.4/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread' 2018-01-27T00:29:38.048145+00:00 app[web.1]: 2018-01-27T00:29:38.048147+00:00 app[web.1]: 2018-01-27T00:29:38.582626+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=icecreamer-staging.herokuapp.com request_id=8902b800-dfec-4d18-be2b-3f9382ab0971 fwd="106.154.6.191" dyno=web.1 connect=1ms service=5ms status=200 bytes=228 protocol=https 2018-01-27T00:31:43.867919+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user vol.eott@gmail.com 2018-01-27T00:31:49.290679+00:00 heroku[run.3223]: Awaiting client 2018-01-27T00:31:49.348688+00:00 heroku[run.3223]: Starting process with command `bundle exec rake db:migrate` 2018-01-27T00:31:49.416506+00:00 heroku[run.3223]: State changed from starting to up 2018-01-27T00:31:59.678459+00:00 heroku[run.3223]: State changed from up to complete 2018-01-27T00:31:59.661036+00:00 heroku[run.3223]: Process exited with status 1 2018-01-27T00:32:05.444038+00:00 app[web.1]: Started GET "/" for 106.154.6.191 at 2018-01-27 00:32:05 +0000 2018-01-27T00:32:05.445906+00:00 app[web.1]: 2018-01-27T00:32:05.445912+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/mysql2-0.3.20/lib/mysql2/client.rb:70:in `connect' 2018-01-27T00:32:05.445916+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new' 2018-01-27T00:32:05.445910+00:00 app[web.1]: Mysql2::Error (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)): 2018-01-27T00:32:05.445920+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection' 2018-01-27T00:32:05.445913+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/mysql2-0.3.20/lib/mysql2/client.rb:70:in `initialize' 2018-01-27T00:32:05.445918+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection' 2018-01-27T00:32:05.445924+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection' 2018-01-27T00:32:05.445922+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection' 2018-01-27T00:32:05.445926+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout' 2018-01-27T00:32:05.445930+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout' 2018-01-27T00:32:05.445932+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection' 2018-01-27T00:32:05.445934+00:00 app[web.1]: vendor/ruby-2.3.4/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' 2018-01-27T00:32:05.445928+00:00 app[web.1]: vendor/ruby-2.3.4/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' 2018-01-27T00:32:05.445941+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:87:in `connection' 2018-01-27T00:32:05.445937+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection' 2018-01-27T00:32:05.445939+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:113:in `retrieve_connection' 2018-01-27T00:32:05.445944+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/query_cache.rb:43:in `rescue in call' 2018-01-27T00:32:05.445953+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_call_callbacks' 2018-01-27T00:32:05.445935+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection' 2018-01-27T00:32:05.445946+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/query_cache.rb:31:in `call' 2018-01-27T00:32:05.445951+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:88:in `__run_callbacks__' 2018-01-27T00:32:05.445954+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_cal
退会済みユーザー

退会済みユーザー

2018/01/27 00:38

文字制限で本文に追記できなかったので、こちらに heroku logsコマンド を記載しました。よろしくお願い致します。
退会済みユーザー

退会済みユーザー

2018/01/27 00:39

回答ありがとうございます。dbの設定ファイルはどこで確認することができるでしょうか?
mtdsnsk

2018/01/27 21:24

config/database.ymlの`production`の項目を確認して貼り付けてください
退会済みユーザー

退会済みユーザー

2018/01/27 23:56

config/database.ymlの`production`を追記いたしました。
guest

回答1

0

Mysql2::Error (Can't connect to local MySQL server through socket '/tmp/mysql.sock'

MySQLに接続できないというエラーが出ているので、解消しましょう。
解消の仕方は下記を参考に。
http://arfyasu.hatenablog.com/entry/2016/01/11/035101

投稿2018/01/27 21:24

mtdsnsk

総合スコア789

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

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

退会済みユーザー

退会済みユーザー

2018/01/27 23:54

回答ありがとうございます。 heroku config:set DATABASE_URL=mysql2://b3096b〜 を実行してMySQLを設定しました。 その後、heroku run rake db:migrate --remote stagingを実行するものの、rake aborted! Mysql2::Error: Access denied for user〜 というエラーが発生してしまいます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問