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

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

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

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

Ruby on Rails

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

Q&A

0回答

176閲覧

herokuでエラーが出るため正常にデプロイできない

shimony2k

総合スコア22

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2020/08/10 14:20

herokuを使用してRailsアプリをデプロイしようとしております。
herokuでアプリを作成して、下記の「git push heroku master」まで正常に行うことができました。
しかしherokuにデータベースを作る「heroku run rails db:migrate」を実行すると下記のようなエラーが出ました。
以前「logos」と「picture」のモデルを作成して削除したのですが、それが今回の原因になっていると考えております。
どのように処理すると正常になりますでしょうか?
あまり具体的に分析できていないため、情報が不足しているかもしれませんが何卒ご解説をいただけると幸いです。
よろしくお願いします。

› Warning: heroku update available from 7.38.0 to 7.42.5. Running rails db:migrate on ⬢ servicesimsearch... up, run.5273 (Free) (3.9ms) SELECT pg_try_advisory_lock(2649699517658720205) (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to AddServicesToLogos (20200607090401) (4.2ms) BEGIN == 20200607090401 AddServicesToLogos: migrating =============================== -- add_column(:logos, :picture, :string) (1.7ms) ALTER TABLE "logos" ADD "picture" character varying (1.2ms) ROLLBACK (2.0ms) SELECT pg_advisory_unlock(2649699517658720205) rails aborted! StandardError: An error has occurred, this and all later migrations canceled: PG::UndefinedTable: ERROR: relation "logos" does not exist : ALTER TABLE "logos" ADD "picture" character varying /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `async_exec' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels ) in execute' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execut e' 〜 〜 Caused by: PG::UndefinedTable: ERROR: relation "logos" does not exist /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `async_exec' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels ) in execute' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execut e' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:581:in `add_column' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:420:in `add_column' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:871:in `block in method_missing' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `block in say_with_time' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `say_with_time' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:860:in `method_missing' /app/db/migrate/20200607090401_add_services_to_logos.rb:3:in `change' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:814:in `exec_migration' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問