前提・実現したいこと
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]
色々試しましたがよくわからなくなってきてしまいました。
書き方としてわかりにくいところがあれば申し訳ございません。
ご助力賜れれば幸いです。どうぞよろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。