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

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

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

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

Ruby on Rails

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

Q&A

解決済

2回答

757閲覧

rails tutorial 第11章 第4版 にて git push heroku ができない

kaeru-

総合スコア4

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2020/04/21 02:00

前提・実現したいこと

rails tutorial 第11章 第4版 にて git push heroku をしたい

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

リスト11.41のproduction.rbを変更後、git push herokuを行った際に発生しました。

remote: rake aborted! remote: NoMethodError: undefined method `dafault_url_options=' for ActionMailer::Base:Class remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:580:in `method_missing' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.1.6/lib/action_mailer/railtie.rb:47:in `block (3 levels) in <class:Railtie>' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.1.6/lib/action_mailer/railtie.rb:47:in `each' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.1.6/lib/action_mailer/railtie.rb:47:in `block (2 levels) in <class:Railtie>' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:41:in `block in on_load' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:40:in `each' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/lazy_load_hooks.rb:40:in `on_load' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/actionmailer-5.1.6/lib/action_mailer/railtie.rb:38:in `block in <class:Railtie>' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in `block in run_initializers' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/config/environment.rb:5:in `<top (required)>' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require_environment!' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:445:in `block in run_tasks_blocks' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define' remote: /tmp/build_acee381ede9aa3ce158b3bccc2aafd4c/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' remote: Tasks: TOP => environment remote: (See full trace by running task with --trace) remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to limitless-sea-76738. remote: To https://git.heroku.com/limitless-sea-76738.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/limitless-sea-76738.git'

該当のソースコード

production.rb

ruby

1 config.action_mailer.raise_delivery_errors = true 2 config.action_mailer.delivery_method = :smtp 3 host = 'https://limitless-sea-76738.herokuapp.com' 4 config.action_mailer.default_url_options = { host: host } 5 ActionMailer::Base.smtp_settings = { 6 :address => 'smtp.sendgrid.net', 7 :port => '587', 8 :authentication => :plain, 9 :user_name => ENV['SENDGRID_USERNAME'], 10 :password => ENV['SENDGRID_PASSWORD'], 11 :domain => 'heroku.com', 12 :enable_starttls_auto => true 13 }

application_mailer.rb

class ApplicationMailer < ActionMailer::Base default from: "noreply@example.com" layout 'mailer' end

試したこと

再度bundle installをする

production.rbとdevelopment.rbの変数hostのURLの変更

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

cloud9
Gemfile

source 'https://rubygems.org' gem 'rails', '5.1.6' gem 'bcrypt', '3.1.12' gem 'faker', '1.7.3' gem 'will_paginate', '3.1.6' gem 'bootstrap-will_paginate', '1.0.0' gem 'bootstrap-sass', '3.3.7' gem 'puma', '3.9.1' gem 'sass-rails', '5.0.6' gem 'uglifier', '3.2.0' gem 'coffee-rails', '4.2.2' gem 'jquery-rails', '4.3.1' gem 'turbolinks', '5.0.1' gem 'jbuilder', '2.7.0' group :development, :test do gem 'sqlite3', '1.3.13' gem 'byebug', '9.0.6', platform: :mri end group :development do gem 'web-console', '3.5.1' gem 'listen', '3.1.5' gem 'spring', '2.0.2' gem 'spring-watcher-listen', '2.0.1' end group :test do gem 'rails-controller-testing', '1.0.2' gem 'minitest', '5.10.3' gem 'minitest-reporters', '1.1.14' gem 'guard', '2.16.2' gem 'guard-minitest', '2.4.4' end group :production do gem 'pg', '0.20.0' end # Windows環境ではtzinfo-dataというgemを含める必要があります gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

色々試しましたがよくわからなくなってきてしまいました。
書き方としてわかりにくいところがあれば申し訳ございません。
ご助力賜れれば幸いです。どうぞよろしくお願いいたします。

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

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

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

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

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

guest

回答2

0

自己解決

第10章までのクローンを作成して一からやったら、今回のエラーは解決できてしまいました。

最初との相違点は11.3.3.3の演習課題をやったかやってないかの違いだと思われます。
もともとテストがGreenだったのでいまいち原因がわからないです。
下記を参考に解かせていただきました。
また別のエラーが出たので先に進みます。
お騒がせしました。

〜参考〜
https://qiita.com/punkshiraishi/items/765a0701df5dba970ccf

投稿2020/04/24 01:45

kaeru-

総合スコア4

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

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

0

NoMethodError: undefined method `dafault_url_options=' for ActionMailer::Base:Class

とのことなので、下記でいかがでしょうか?

host = 'limitless-sea-76738.herokuapp.com'

投稿2020/04/21 03:18

no1knows

総合スコア3365

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

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

kaeru-

2020/04/21 04:15

ご回答ありがとうありがとうございます。 そちらのコードで試してみましたが、変わらず同じエラーが出てしまいました。。。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問