私は、今現在、サインアップページに利用規約を追加しようとしているのですが、Interval Server Errorを発生していて、ページが見えない状態になっています。localでは動くのですが、デプロイすると動かなくなります。わかる方がいらしたら、どうぞ教えていただきたいです。
Heroku logs
terminal
12019-08-22T13:31:36.184273+00:00 app[web.1]: Started GET "/guiders/sign_up" for 162.158.118.161 at 2019-08-22 13:31:36 +0000 22019-08-22T13:31:36.190461+00:00 app[web.1]: Processing by Guiders::RegistrationsController#new as HTML 32019-08-22T13:31:36.233898+00:00 app[web.1]: Rendered guiders/registrations/new.html.erb within layouts/application (28.7ms) 42019-08-22T13:31:36.234153+00:00 app[web.1]: Completed 500 Internal Server Error in 44ms (ActiveRecord: 0.0ms) 52019-08-22T13:31:36.239764+00:00 app[web.1]: 62019-08-22T13:31:36.239768+00:00 app[web.1]: ActionView::Template::Error (undefined method `accepted' for #<Guider:0x0000558b5178fe38>): 72019-08-22T13:31:36.239772+00:00 app[web.1]: 28: <%= f.text_field :nickname, autofocus: true, maxlength: "6" %> 82019-08-22T13:31:36.239774+00:00 app[web.1]: 29: </div> 92019-08-22T13:31:36.239776+00:00 app[web.1]: 30: 102019-08-22T13:31:36.239778+00:00 app[web.1]: 31: <%= f.check_box :accepted ,{},checked_value = "true",unchecked_value = "false" %> 112019-08-22T13:31:36.239781+00:00 app[web.1]: 32: <a class="ac" href="/guiders/:id/accepted">利用規約、及び、個人情報の取扱に同意する</a> 122019-08-22T13:31:36.239783+00:00 app[web.1]: 33: 132019-08-22T13:31:36.239785+00:00 app[web.1]: 34: <div class="actions"> 142019-08-22T13:31:36.239788+00:00 app[web.1]: app/views/guiders/registrations/new.html.erb:31:in `block in _app_views_guiders_registrations_new_html_erb___1610938150473438876_47028427832020' 152019-08-22T13:31:36.239791+00:00 app[web.1]: app/views/guiders/registrations/new.html.erb:3:in `_app_views_guiders_registrations_new_html_erb___1610938150473438876_47028427832020' 162019-08-22T13:31:36.239793+00:00 app[web.1]: 172019-08-22T13:31:36.239795+00:00 app[web.1]: 182019-08-22T13:31:36.239272+00:00 heroku[router]: at=info method=GET path="/guiders/sign_up" request_id=eab95b38-2c21-49c4-9d25-0895d8150b1a fwd="118.103.63.155,162.158.118.161" dyno=web.1 connect=1ms service=58ms status=500 bytes=1728 protocol=https 19
webpage
1Failed to load resource: the server responded with a statue of 500(Internal Server Error)
gemfile
1source 'https://rubygems.org' 2 3 4# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5gem 'rails', '4.2.11' 6# Use mysql as the database for Active Record 7gem 'mysql2', '0.3.18' 8# Use SCSS for stylesheets 9gem 'sass-rails', '~> 4.0.2' 10# Use Uglifier as compressor for JavaScript assets 11gem 'uglifier', '>= 1.3.0' 12# Use CoffeeScript for .coffee assets and views 13gem 'coffee-rails', '~> 4.1.0' 14# See https://github.com/rails/execjs#readme for more supported runtimes 15# gem 'therubyracer', platforms: :ruby 16 17# Use jquery as the JavaScript library 18gem 'jquery-rails' 19# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 20gem 'turbolinks' 21# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 22gem 'jbuilder', '~> 2.0' 23# bundle exec rake doc:rails generates the API under doc/api. 24gem 'sdoc', '~> 0.4.0', group: :doc 25 26# Use ActiveModel has_secure_password 27# gem 'bcrypt', '~> 3.1.7' 28 29# Use Unicorn as the app server 30# gem 'unicorn' 31 32# Use Capistrano for deployment 33# gem 'capistrano-rails', group: :development 34 35group :development, :test do 36 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 37 gem 'byebug' 38end 39 40group :development do 41 # Access an IRB console on exception pages or by using <%= console %> in views 42 gem 'web-console', '~> 2.0' 43 44 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 45 gem 'spring' 46end 47 48gem 'pry-rails' 49gem 'compass-rails','~> 2.0' 50gem 'sprockets', '2.11.0' 51gem 'websocket-rails' 52 53#pagenation 54gem 'kaminari' 55 56#login_logout 57gem 'devise' 58gem 'paperclip' 59 60#For Heroku 61gem 'rails_12factor', group: :production 62gem 'therubyracer', platforms: :ruby 63 64#画像 65gem 'carrierwave' 66gem 'rmagick'
view
1<div class="contents center"> 2 3 <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> 4 <%= devise_error_messages! %> 5 6 <h2 class="ue">Sign up</h2> 7 8 <div class="field"> 9 <%= f.label :email %><br /> 10 <%= f.email_field :email %> 11 </div> 12 13 <div class="field"> 14 <%= f.label :password %> 15 <% if @validatable %> 16 <em>(<%= @minimum_password_length %> characters minimum)</em> 17 <% end %><br /> 18 <%= f.password_field :password, autocomplete: "off" %> 19 </div> 20 21 <div class="field"> 22 <%= f.label :password_confirmation %><br /> 23 <%= f.password_field :password_confirmation, autocomplete: "off" %> 24 </div> 25 26 <div class="field"> 27 <%= f.label :nickname %> <em>(6 characters maximum)</em><br /> 28 <%= f.text_field :nickname, autofocus: true, maxlength: "6" %> 29 </div> 30 31 <%= f.check_box :accepted ,{},checked_value = "true",unchecked_value = "false" %> 32 <a class="ac" href="/guiders/:id/accepted">利用規約、及び、個人情報の取扱に同意する</a> 33 34 <div class="actions"> 35 <%= f.submit "Sign up" %> 36 </div> 37 38 <div class="shita"> 39 <%= render "guiders/shared/links" %> 40 </div> 41 42 <% end %> 43</div>
model
1class Guider < ActiveRecord::Base 2 # Include default devise modules. Others available are: 3 validates :accepted, presence: {message: 'を入力してください'} 4end
routes.rb
1Rails.application.routes.draw do 2 devise_for :tourists, controllers: { 3 4 sessions: 'tourists/sessions', 5 passwords: 'tourists/passwords', 6 registrations: 'tourists/registrations' 7 } 8 9 devise_for :guiders, controllers: { 10 sessions: 'guiders/sessions', 11 passwords: 'guiders/passwords', 12 registrations: 'guiders/registrations' 13 } 14 get "/guiders/:id/accepted" => "guiders#accepted"
回答1件
あなたの回答
tips
プレビュー