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

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

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

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

Heroku

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

Q&A

解決済

1回答

570閲覧

heroku run console error

退会済みユーザー

退会済みユーザー

総合スコア0

Ruby on Rails 6

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

Heroku

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

0グッド

0クリップ

投稿2021/02/17 03:56

heorkuでapplication errorが出たので、ターミナルでheroku logs --tail
をしたらこのようなエラーがおきました。

2021-02-17T03:43:06.341809+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:147:in `block in perform' 2021-02-17T03:43:06.341832+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:138:in `tap' 2021-02-17T03:43:06.341857+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:138:in `perform' 2021-02-17T03:43:06.341880+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 2021-02-17T03:43:06.341905+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 2021-02-17T03:43:06.341926+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 2021-02-17T03:43:06.341950+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.2/lib/rails/command/base.rb:69:in `perform' 2021-02-17T03:43:06.341971+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.2/lib/rails/command.rb:46:in `invoke' 2021-02-17T03:43:06.341994+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.2/lib/rails/commands.rb:18:in `<main>' 2021-02-17T03:43:06.342019+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 2021-02-17T03:43:06.342048+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 2021-02-17T03:43:06.342074+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 2021-02-17T03:43:06.342097+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 2021-02-17T03:43:06.342122+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 2021-02-17T03:43:06.342143+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require' 2021-02-17T03:43:06.342167+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency' 2021-02-17T03:43:06.342191+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require' 2021-02-17T03:43:06.342213+00:00 app[web.1]: from bin/rails:9:in `<main>' 2021-02-17T03:43:06.492067+00:00 heroku[web.1]: Process exited with status 1 2021-02-17T03:43:06.557797+00:00 heroku[web.1]: State changed from starting to crashed 2021-02-17T03:43:08.841235+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=chatspace25.herokuapp.com request_id=d9979332-87ab-4c7d-9ab1-365929d0beb2 fwd="119.170.84.173" dyno= connect= service= status=503 bytes= protocol=https 2021-02-17T03:43:09.894978+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=chatspace25.herokuapp.com request_id=39c69a7e-34b7-4ceb-ab0a-4511b26424b9 fwd="119.170.84.173" dyno= connect= service= status=503 bytes= protocol=https 2021-02-17T03:43:47.627125+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=chatspace25.herokuapp.com request_id=fbc51083-1764-4881-9642-1659d77ddc61 fwd="119.170.84.173" dyno= connect= service= status=503 bytes= protocol=https 2021-02-17T03:43:48.047873+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=chatspace25.herokuapp.com request_id=02341cdf-2717-4cd6-b59c-6ed18881581a fwd="119.170.84.173" dyno= connect= service= status=503 bytes= protocol=https 2021-02-17T03:46:42.718774+00:00 heroku[web.1]: State changed from crashed to starting 2021-02-17T03:46:50.575015+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production` 2021-02-17T03:46:56.708340+00:00 app[web.1]: => Booting Puma 2021-02-17T03:46:56.708389+00:00 app[web.1]: => Rails 6.0.3.2 application starting in production 2021-02-17T03:46:56.708389+00:00 app[web.1]: => Run `rails server --help` for more startup options 2021-02-17T03:46:57.647824+00:00 app[web.1]: Exiting 2021-02-17T03:46:57.648164+00:00 app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/fog-core-2.2.0/lib/fog/core/service.rb:244:in `validate_options': Missing required arguments: aws_access_key_id, aws_secret_access_key (ArgumentError)

みてみるとArgumenterrorが表示されています。
何かaws関係でエラーが起きているように思われまうがよく分かりません。
gemfileとdatabase.ymlが関係しているのかと思いますので

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.5' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.0' # Use mysql as the database for Active Record gem 'mysql2', '>= 0.4.4' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '~> 5' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem 'webpacker', '~> 4.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Active Storage variant # gem 'image_processing', '~> 1.2' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.4.2', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' gem 'sqlite3' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem "haml-rails", ">= 1.0", '<= 2.0.1' gem 'font-awesome-sass' gem 'devise' gem 'pry-rails' gem 'carrierwave' gem 'mini_magick' gem 'jquery-rails' gem 'fog-aws' group :production do gem 'unicorn', '5.4.1' gem 'pg' end group :development, :test do gem 'capistrano' gem 'capistrano-rbenv' gem 'capistrano-bundler' gem 'capistrano-rails' gem 'capistrano3-unicorn' end
# # Install the MySQL driver # gem install mysql2 # # Ensure the MySQL gem is defined in your Gemfile # gem 'mysql2' # # And be sure to use new-style password hashing: # https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html # default: &default adapter: mysql2 encoding: utf8 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root password: socket: /tmp/mysql.sock development: <<: *default database: chat_space_development # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: chat_space_test # As with config/credentials.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is # ever seen by anyone, they now have access to your database. # # Instead, provide the password as a unix environment variable when you boot # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database # for a full rundown on how to provide these environment variables in a # production deployment. # # On Heroku and other platform providers, you may have a full connection URL # available as an environment variable. For example: # # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" # # You can use this database configuration with: # # production: # url: <%= ENV['DATABASE_URL'] %> # production: <<: *default database: chat_space_production username: root password: <%= ENV['DATABASE_PASSWORD'] %> socket: /var/lib/mysql/mysql.sock adapter: postgresql encoding: unicode pool: 5

こちらに載せておきます。

どなたかご教授お願いい致します。

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

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

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

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

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

guest

回答1

0

ベストアンサー

dbは関係ありません
AWSのaccess keyが設定されてないことによるエラーです。
AWSのセキュリティ認証情報からaccess keyとsecret access keyを発行するとよいです、

https://devcenter.heroku.com/ja/articles/config-vars

heroku config:set AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-west-2

AWSアカウント発行を出来ない場合、bucketeerというaddonを使う方法もあります

投稿2021/02/17 10:13

kyohah

総合スコア96

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

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

退会済みユーザー

退会済みユーザー

2021/02/17 14:16

ありがとうございます!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問