我目前正在浏览Odin项目并创建了我的第一个rails应用程序。现在我正在尝试将它部署到我以前做过的Heroku,但这次它不会加载页面。每当我在终端中运行Heroku时,Safari会弹出,因为“太多重定向”而无法加载。我不确定从哪里开始解决这个问题。 Heroku应用链接为https://damp-ravine-93217.herokuapp.com。 这是我的config / routes.rb文件:
Rails.application.routes.draw do
get 'author/Sessions'
resources :articles do
resources :comments
end
resources :tags
resources :authors
resources :author_sessions, only: [ :new, :create, :destroy ]
get 'login' => 'author_sessions#new'
get 'logout' => 'author_sessions#destroy'
root to: 'articles#index'
end
我的Gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gem 'sorcery'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.4'
# Use sqlite3 as the database for Active Record
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'paperclip'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
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]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
gem 'sqlite3'
end
group :development do
# Access an IRB console on exception pages or by using <%= 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'
end
group :production do
gem 'pg'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
这是我的Heroku日志:
Marcuss-MacBook-Pro:blogger marcus$ heroku logs
2017-10-11T02:59:33.316129+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=1a14b22d-054e-4881-9f50-7138feaa6af9 fwd="68.113.36.43" dyno=web.1 connect=0ms service=12ms status=302 bytes=806 protocol=https
2017-10-11T02:59:33.313223+00:00 app[web.1]: I, [2017-10-11T02:59:33.311838 #4] INFO -- : [1a14b22d-054e-4881-9f50-7138feaa6af9] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:33 +0000
2017-10-11T02:59:33.314440+00:00 app[web.1]: I, [2017-10-11T02:59:33.314362 #4] INFO -- : [1a14b22d-054e-4881-9f50-7138feaa6af9] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.315819+00:00 app[web.1]: I, [2017-10-11T02:59:33.315719 #4] INFO -- : [1a14b22d-054e-4881-9f50-7138feaa6af9] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:33.316008+00:00 app[web.1]: I, [2017-10-11T02:59:33.315911 #4] INFO -- : [1a14b22d-054e-4881-9f50-7138feaa6af9] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:33.316236+00:00 app[web.1]: I, [2017-10-11T02:59:33.316159 #4] INFO -- : [1a14b22d-054e-4881-9f50-7138feaa6af9] Completed 302 Found in 2ms
2017-10-11T02:59:33.429473+00:00 app[web.1]: I, [2017-10-11T02:59:33.429350 #4] INFO -- : [d2637cad-cd5e-4aa2-b745-5b3a9f29d619] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:33 +0000
2017-10-11T02:59:33.438373+00:00 app[web.1]: I, [2017-10-11T02:59:33.438262 #4] INFO -- : [d2637cad-cd5e-4aa2-b745-5b3a9f29d619] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.439328+00:00 app[web.1]: I, [2017-10-11T02:59:33.439251 #4] INFO -- : [d2637cad-cd5e-4aa2-b745-5b3a9f29d619] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:33.439493+00:00 app[web.1]: I, [2017-10-11T02:59:33.439426 #4] INFO -- : [d2637cad-cd5e-4aa2-b745-5b3a9f29d619] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:33.439657+00:00 app[web.1]: I, [2017-10-11T02:59:33.439593 #4] INFO -- : [d2637cad-cd5e-4aa2-b745-5b3a9f29d619] Completed 302 Found in 1ms
2017-10-11T02:59:33.554792+00:00 app[web.1]: I, [2017-10-11T02:59:33.554668 #4] INFO -- : [eaf81f4a-ddfc-441b-bf61-537208d2fae1] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:33 +0000
2017-10-11T02:59:33.555657+00:00 app[web.1]: I, [2017-10-11T02:59:33.555583 #4] INFO -- : [eaf81f4a-ddfc-441b-bf61-537208d2fae1] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.556582+00:00 app[web.1]: I, [2017-10-11T02:59:33.556508 #4] INFO -- : [eaf81f4a-ddfc-441b-bf61-537208d2fae1] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:33.556750+00:00 app[web.1]: I, [2017-10-11T02:59:33.556670 #4] INFO -- : [eaf81f4a-ddfc-441b-bf61-537208d2fae1] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:33.556911+00:00 app[web.1]: I, [2017-10-11T02:59:33.556843 #4] INFO -- : [eaf81f4a-ddfc-441b-bf61-537208d2fae1] Completed 302 Found in 1ms
2017-10-11T02:59:33.672073+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=68bd1991-d208-4431-8c26-f4e1c1740f18 fwd="68.113.36.43" dyno=web.1 connect=0ms service=8ms status=302 bytes=806 protocol=https
2017-10-11T02:59:33.556658+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=eaf81f4a-ddfc-441b-bf61-537208d2fae1 fwd="68.113.36.43" dyno=web.1 connect=0ms service=5ms status=302 bytes=806 protocol=https
2017-10-11T02:59:33.780386+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=51814dfc-a0c2-48f3-a3e1-331bcbc389c5 fwd="68.113.36.43" dyno=web.1 connect=0ms service=4ms status=302 bytes=806 protocol=https
2017-10-11T02:59:33.667278+00:00 app[web.1]: I, [2017-10-11T02:59:33.667197 #4] INFO -- : [68bd1991-d208-4431-8c26-f4e1c1740f18] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:33 +0000
2017-10-11T02:59:33.670929+00:00 app[web.1]: I, [2017-10-11T02:59:33.670860 #4] INFO -- : [68bd1991-d208-4431-8c26-f4e1c1740f18] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.671910+00:00 app[web.1]: I, [2017-10-11T02:59:33.671841 #4] INFO -- : [68bd1991-d208-4431-8c26-f4e1c1740f18] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:33.672109+00:00 app[web.1]: I, [2017-10-11T02:59:33.672044 #4] INFO -- : [68bd1991-d208-4431-8c26-f4e1c1740f18] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:33.672303+00:00 app[web.1]: I, [2017-10-11T02:59:33.672237 #4] INFO -- : [68bd1991-d208-4431-8c26-f4e1c1740f18] Completed 302 Found in 1ms
2017-10-11T02:59:33.778413+00:00 app[web.1]: I, [2017-10-11T02:59:33.778311 #4] INFO -- : [51814dfc-a0c2-48f3-a3e1-331bcbc389c5] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:33 +0000
2017-10-11T02:59:33.779416+00:00 app[web.1]: I, [2017-10-11T02:59:33.779346 #4] INFO -- : [51814dfc-a0c2-48f3-a3e1-331bcbc389c5] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.780363+00:00 app[web.1]: I, [2017-10-11T02:59:33.780295 #4] INFO -- : [51814dfc-a0c2-48f3-a3e1-331bcbc389c5] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:33.780561+00:00 app[web.1]: I, [2017-10-11T02:59:33.780485 #4] INFO -- : [51814dfc-a0c2-48f3-a3e1-331bcbc389c5] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:33.780741+00:00 app[web.1]: I, [2017-10-11T02:59:33.780677 #4] INFO -- : [51814dfc-a0c2-48f3-a3e1-331bcbc389c5] Completed 302 Found in 1ms
2017-10-11T02:59:33.885106+00:00 app[web.1]: I, [2017-10-11T02:59:33.885000 #4] INFO -- : [e5f1f408-ff92-4aac-bfaf-76277fdf25e6] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:33 +0000
2017-10-11T02:59:33.885946+00:00 app[web.1]: I, [2017-10-11T02:59:33.885871 #4] INFO -- : [e5f1f408-ff92-4aac-bfaf-76277fdf25e6] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.887290+00:00 app[web.1]: I, [2017-10-11T02:59:33.887205 #4] INFO -- : [e5f1f408-ff92-4aac-bfaf-76277fdf25e6] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:33.887536+00:00 app[web.1]: I, [2017-10-11T02:59:33.887381 #4] INFO -- : [e5f1f408-ff92-4aac-bfaf-76277fdf25e6] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:33.887596+00:00 app[web.1]: I, [2017-10-11T02:59:33.887526 #4] INFO -- : [e5f1f408-ff92-4aac-bfaf-76277fdf25e6] Completed 302 Found in 2ms
2017-10-11T02:59:33.887516+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=e5f1f408-ff92-4aac-bfaf-76277fdf25e6 fwd="68.113.36.43" dyno=web.1 connect=0ms service=5ms status=302 bytes=806 protocol=https
2017-10-11T02:59:33.994875+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=6ed7cd7a-2d41-4296-8908-0e10d0971fa4 fwd="68.113.36.43" dyno=web.1 connect=0ms service=4ms status=302 bytes=806 protocol=https
2017-10-11T02:59:33.993235+00:00 app[web.1]: I, [2017-10-11T02:59:33.993145 #4] INFO -- : [6ed7cd7a-2d41-4296-8908-0e10d0971fa4] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:33 +0000
2017-10-11T02:59:33.995176+00:00 app[web.1]: I, [2017-10-11T02:59:33.995112 #4] INFO -- : [6ed7cd7a-2d41-4296-8908-0e10d0971fa4] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.102471+00:00 app[web.1]: I, [2017-10-11T02:59:34.102387 #4] INFO -- : [8aba1587-469b-43dd-a0e6-e062f96f63a0] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.102595+00:00 app[web.1]: I, [2017-10-11T02:59:34.102537 #4] INFO -- : [8aba1587-469b-43dd-a0e6-e062f96f63a0] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.099513+00:00 app[web.1]: I, [2017-10-11T02:59:34.099372 #4] INFO -- : [8aba1587-469b-43dd-a0e6-e062f96f63a0] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.208056+00:00 app[web.1]: I, [2017-10-11T02:59:34.207953 #4] INFO -- : [12eb086b-1a23-4378-92c1-e2a4ad9f4615] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.101425+00:00 app[web.1]: I, [2017-10-11T02:59:34.101355 #4] INFO -- : [8aba1587-469b-43dd-a0e6-e062f96f63a0] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.995326+00:00 app[web.1]: I, [2017-10-11T02:59:33.995263 #4] INFO -- : [6ed7cd7a-2d41-4296-8908-0e10d0971fa4] Completed 302 Found in 1ms
2017-10-11T02:59:34.208930+00:00 app[web.1]: I, [2017-10-11T02:59:34.208843 #4] INFO -- : [12eb086b-1a23-4378-92c1-e2a4ad9f4615] Processing by ArticlesController#index as HTML
2017-10-11T02:59:33.995046+00:00 app[web.1]: I, [2017-10-11T02:59:33.994954 #4] INFO -- : [6ed7cd7a-2d41-4296-8908-0e10d0971fa4] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.210082+00:00 app[web.1]: I, [2017-10-11T02:59:34.210012 #4] INFO -- : [12eb086b-1a23-4378-92c1-e2a4ad9f4615] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.210297+00:00 app[web.1]: I, [2017-10-11T02:59:34.210231 #4] INFO -- : [12eb086b-1a23-4378-92c1-e2a4ad9f4615] Completed 302 Found in 1ms
2017-10-11T02:59:34.209918+00:00 app[web.1]: I, [2017-10-11T02:59:34.209834 #4] INFO -- : [12eb086b-1a23-4378-92c1-e2a4ad9f4615] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.102719+00:00 app[web.1]: I, [2017-10-11T02:59:34.102660 #4] INFO -- : [8aba1587-469b-43dd-a0e6-e062f96f63a0] Completed 302 Found in 1ms
2017-10-11T02:59:33.994117+00:00 app[web.1]: I, [2017-10-11T02:59:33.994046 #4] INFO -- : [6ed7cd7a-2d41-4296-8908-0e10d0971fa4] Processing by ArticlesController#index as HTML
2017-10-11T02:59:34.102038+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=8aba1587-469b-43dd-a0e6-e062f96f63a0 fwd="68.113.36.43" dyno=web.1 connect=0ms service=5ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.209930+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=12eb086b-1a23-4378-92c1-e2a4ad9f4615 fwd="68.113.36.43" dyno=web.1 connect=0ms service=4ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.320370+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=75bf3a5d-5cfc-4463-b974-3724de6a4f71 fwd="68.113.36.43" dyno=web.1 connect=0ms service=6ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.460365+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=cc1d3677-36f3-4d07-ad96-132699b5f1c8 fwd="68.113.36.43" dyno=web.1 connect=1ms service=10ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.318036+00:00 app[web.1]: I, [2017-10-11T02:59:34.317944 #4] INFO -- : [75bf3a5d-5cfc-4463-b974-3724de6a4f71] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.319197+00:00 app[web.1]: I, [2017-10-11T02:59:34.319046 #4] INFO -- : [75bf3a5d-5cfc-4463-b974-3724de6a4f71] Processing by ArticlesController#index as HTML
2017-10-11T02:59:34.320563+00:00 app[web.1]: I, [2017-10-11T02:59:34.320475 #4] INFO -- : [75bf3a5d-5cfc-4463-b974-3724de6a4f71] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.320700+00:00 app[web.1]: I, [2017-10-11T02:59:34.320632 #4] INFO -- : [75bf3a5d-5cfc-4463-b974-3724de6a4f71] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.320857+00:00 app[web.1]: I, [2017-10-11T02:59:34.320787 #4] INFO -- : [75bf3a5d-5cfc-4463-b974-3724de6a4f71] Completed 302 Found in 1ms
2017-10-11T02:59:34.455793+00:00 app[web.1]: I, [2017-10-11T02:59:34.455706 #4] INFO -- : [cc1d3677-36f3-4d07-ad96-132699b5f1c8] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.457460+00:00 app[web.1]: I, [2017-10-11T02:59:34.457268 #4] INFO -- : [cc1d3677-36f3-4d07-ad96-132699b5f1c8] Processing by ArticlesController#index as HTML
2017-10-11T02:59:34.458665+00:00 app[web.1]: I, [2017-10-11T02:59:34.458603 #4] INFO -- : [cc1d3677-36f3-4d07-ad96-132699b5f1c8] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.458857+00:00 app[web.1]: I, [2017-10-11T02:59:34.458801 #4] INFO -- : [cc1d3677-36f3-4d07-ad96-132699b5f1c8] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.459070+00:00 app[web.1]: I, [2017-10-11T02:59:34.458988 #4] INFO -- : [cc1d3677-36f3-4d07-ad96-132699b5f1c8] Completed 302 Found in 1ms
2017-10-11T02:59:34.566942+00:00 app[web.1]: I, [2017-10-11T02:59:34.566845 #4] INFO -- : [42d5b3f0-2416-4fac-b78f-0e34b30737e3] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.567743+00:00 app[web.1]: I, [2017-10-11T02:59:34.567679 #4] INFO -- : [42d5b3f0-2416-4fac-b78f-0e34b30737e3] Processing by ArticlesController#index as HTML
2017-10-11T02:59:34.572470+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=42d5b3f0-2416-4fac-b78f-0e34b30737e3 fwd="68.113.36.43" dyno=web.1 connect=0ms service=9ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.568784+00:00 app[web.1]: I, [2017-10-11T02:59:34.568720 #4] INFO -- : [42d5b3f0-2416-4fac-b78f-0e34b30737e3] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.572487+00:00 app[web.1]: I, [2017-10-11T02:59:34.572420 #4] INFO -- : [42d5b3f0-2416-4fac-b78f-0e34b30737e3] Completed 302 Found in 4ms
2017-10-11T02:59:34.572307+00:00 app[web.1]: I, [2017-10-11T02:59:34.572202 #4] INFO -- : [42d5b3f0-2416-4fac-b78f-0e34b30737e3] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.680103+00:00 app[web.1]: I, [2017-10-11T02:59:34.680016 #4] INFO -- : [36a18c52-458e-4827-9151-5c9e35888312] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.680711+00:00 app[web.1]: I, [2017-10-11T02:59:34.680654 #4] INFO -- : [36a18c52-458e-4827-9151-5c9e35888312] Processing by ArticlesController#index as HTML
2017-10-11T02:59:34.681476+00:00 app[web.1]: I, [2017-10-11T02:59:34.681412 #4] INFO -- : [36a18c52-458e-4827-9151-5c9e35888312] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.681607+00:00 app[web.1]: I, [2017-10-11T02:59:34.681549 #4] INFO -- : [36a18c52-458e-4827-9151-5c9e35888312] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.681794+00:00 app[web.1]: I, [2017-10-11T02:59:34.681729 #4] INFO -- : [36a18c52-458e-4827-9151-5c9e35888312] Completed 302 Found in 1ms
2017-10-11T02:59:34.788498+00:00 app[web.1]: I, [2017-10-11T02:59:34.788400 #4] INFO -- : [9652f0eb-d9f3-4c49-a717-34413979584e] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.789160+00:00 app[web.1]: I, [2017-10-11T02:59:34.789093 #4] INFO -- : [9652f0eb-d9f3-4c49-a717-34413979584e] Processing by ArticlesController#index as HTML
2017-10-11T02:59:34.790212+00:00 app[web.1]: I, [2017-10-11T02:59:34.790123 #4] INFO -- : [9652f0eb-d9f3-4c49-a717-34413979584e] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.790400+00:00 app[web.1]: I, [2017-10-11T02:59:34.790334 #4] INFO -- : [9652f0eb-d9f3-4c49-a717-34413979584e] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.791145+00:00 app[web.1]: I, [2017-10-11T02:59:34.791078 #4] INFO -- : [9652f0eb-d9f3-4c49-a717-34413979584e] Completed 302 Found in 2ms
2017-10-11T02:59:34.681813+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=36a18c52-458e-4827-9151-5c9e35888312 fwd="68.113.36.43" dyno=web.1 connect=0ms service=4ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.790762+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=9652f0eb-d9f3-4c49-a717-34413979584e fwd="68.113.36.43" dyno=web.1 connect=0ms service=4ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.896945+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=a9a7945b-84e3-4231-b6eb-62560a0bc631 fwd="68.113.36.43" dyno=web.1 connect=0ms service=4ms status=302 bytes=806 protocol=https
2017-10-11T02:59:35.010268+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=2e890718-57d3-474f-bbc9-a713d0708c23 fwd="68.113.36.43" dyno=web.1 connect=2ms service=6ms status=302 bytes=806 protocol=https
2017-10-11T02:59:34.895229+00:00 app[web.1]: I, [2017-10-11T02:59:34.895124 #4] INFO -- : [a9a7945b-84e3-4231-b6eb-62560a0bc631] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:34 +0000
2017-10-11T02:59:34.896075+00:00 app[web.1]: I, [2017-10-11T02:59:34.896002 #4] INFO -- : [a9a7945b-84e3-4231-b6eb-62560a0bc631] Processing by ArticlesController#index as HTML
2017-10-11T02:59:34.897002+00:00 app[web.1]: I, [2017-10-11T02:59:34.896931 #4] INFO -- : [a9a7945b-84e3-4231-b6eb-62560a0bc631] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:34.897163+00:00 app[web.1]: I, [2017-10-11T02:59:34.897094 #4] INFO -- : [a9a7945b-84e3-4231-b6eb-62560a0bc631] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:34.897339+00:00 app[web.1]: I, [2017-10-11T02:59:34.897272 #4] INFO -- : [a9a7945b-84e3-4231-b6eb-62560a0bc631] Completed 302 Found in 1ms
2017-10-11T02:59:35.008260+00:00 app[web.1]: I, [2017-10-11T02:59:35.008166 #4] INFO -- : [2e890718-57d3-474f-bbc9-a713d0708c23] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:35 +0000
2017-10-11T02:59:35.009086+00:00 app[web.1]: I, [2017-10-11T02:59:35.009011 #4] INFO -- : [2e890718-57d3-474f-bbc9-a713d0708c23] Processing by ArticlesController#index as HTML
2017-10-11T02:59:35.009992+00:00 app[web.1]: I, [2017-10-11T02:59:35.009917 #4] INFO -- : [2e890718-57d3-474f-bbc9-a713d0708c23] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:35.010130+00:00 app[web.1]: I, [2017-10-11T02:59:35.010072 #4] INFO -- : [2e890718-57d3-474f-bbc9-a713d0708c23] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:35.010329+00:00 app[web.1]: I, [2017-10-11T02:59:35.010265 #4] INFO -- : [2e890718-57d3-474f-bbc9-a713d0708c23] Completed 302 Found in 1ms
2017-10-11T02:59:35.118349+00:00 app[web.1]: I, [2017-10-11T02:59:35.118270 #4] INFO -- : [72ef8cbe-e258-4e4e-aee3-17c62b55c1c5] Started GET "/" for 68.113.36.43 at 2017-10-11 02:59:35 +0000
2017-10-11T02:59:35.119024+00:00 app[web.1]: I, [2017-10-11T02:59:35.118962 #4] INFO -- : [72ef8cbe-e258-4e4e-aee3-17c62b55c1c5] Processing by ArticlesController#index as HTML
2017-10-11T02:59:35.119822+00:00 app[web.1]: I, [2017-10-11T02:59:35.119759 #4] INFO -- : [72ef8cbe-e258-4e4e-aee3-17c62b55c1c5] Redirected to https://damp-ravine-93217.herokuapp.com/
2017-10-11T02:59:35.119960+00:00 app[web.1]: I, [2017-10-11T02:59:35.119895 #4] INFO -- : [72ef8cbe-e258-4e4e-aee3-17c62b55c1c5] Filter chain halted as :require_login rendered or redirected
2017-10-11T02:59:35.120087+00:00 app[web.1]: I, [2017-10-11T02:59:35.120032 #4] INFO -- : [72ef8cbe-e258-4e4e-aee3-17c62b55c1c5] Completed 302 Found in 1ms
2017-10-11T02:59:35.119487+00:00 heroku[router]: at=info method=GET path="/" host=damp-ravine-93217.herokuapp.com request_id=72ef8cbe-e258-4e4e-aee3-17c62b55c1c5 fwd="68.113.36.43" dyno=web.1 connect=0ms service=3ms status=302 bytes=806 protocol=https
这是我的文章控制器:
class ArticlesController < ApplicationController
include ArticlesHelper
before_action :require_login, except[:destroy, :create, :edit, :update, :new]
def index
@articles = Article.all
end
def show
@article = Article.find(params[:id])
@comment = Comment.new
@comment.article_id = @article.id
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
@article.save
flash.notice = "Article #{@article.title} Created"
redirect_to article_path(@article)
end
def destroy
@article = Article.find(params[:id])
@article.destroy
flash.notice = "Article #{@article.title} Deleted"
redirect_to articles_path
end
def edit
@article= Article.find(params[:id])
end
def update
@article=Article.find(params[:id])
@article.update(article_params)
flash.notice = "Article #{@article.title} Updated"
redirect_to article_path(@article)
end
end
提前抱歉造成糟糕的格式化。这是我在Stackoverflow中的第一个问题,我还没有机会进行练习。
编辑:也可能有助于提及它在本地主机中正常工作。