這是我遇到的一個非常奇怪的錯誤。我在軌道上使用紅寶石。一切工作正常(在雲9上),我成功地把它推到Heroku。我已經運行db:migrate沒有錯誤。但是,我收到錯誤「您正在查找的頁面不存在」,並且日誌中顯示404。我檢查了這些文件,並且它們已被正確上傳。 我的路線:Ruby on Rails網站本地工作,路線正確,但在heroku上獲得404
root 'application#index'
get '/index/:type' => 'application#index'
get '/index/' => 'application#index'
get '/benchmark/' => 'application#benchmark'
get '/benchmark/:type' => 'application#benchmark'
get '/benchmarkupdate/:name' => 'application#benchmark'
get '/indexupdate/:name' => 'application#index'
我在正確的位置的文件。我沒有看到路由問題,並且在本地工作。
Heroku的日誌:
2017-04-18T03:13:14.455398+00:00 app[web.1]: * Version 3.8.2 (ruby 2.3.4-p301), codename: Sassy Salamander
2017-04-18T03:13:14.455399+00:00 app[web.1]: * Min threads: 5, max threads: 5
2017-04-18T03:13:14.455399+00:00 app[web.1]: * Environment: production
2017-04-18T03:13:15.493228+00:00 app[web.1]: DEPRECATION WARNING: `config.serve_static_files` is deprecated and will be removed in Rails 5.1.
2017-04-18T03:13:15.493241+00:00 app[web.1]: Please use `config.public_file_server.enabled = true` instead.
2017-04-18T03:13:15.493243+00:00 app[web.1]: (called from block in <top (required)> at /app/config/environments/production.rb:25)
2017-04-18T03:13:16.337785+00:00 app[web.1]: * Listening on tcp://0.0.0.0:49146
2017-04-18T03:13:16.337997+00:00 app[web.1]: Use Ctrl-C to stop
2017-04-18T03:13:16.847301+00:00 heroku[web.1]: State changed from starting to up
2017-04-18T03:13:18.094441+00:00 heroku[router]: at=info method=GET path="/" host=protected-coast-54392.herokuapp.com request_id=3d8c7a3f-3f40-4747-862f-7e70e7c9029e fwd="152.3.34.25" dyno=web.1 connect=1ms service=75ms status=404 bytes=1744 protocol=https
是否有其他任何可能導致此問題?
歡迎使用stackoverflow,請將相關代碼和日誌添加到問題本身作爲文本。沒有截圖。在工具欄上是一個'{}''按鈕,將文本格式化爲代碼。 – max
@Xlsaax我沒有看到你的Heroku的日誌堆棧跟蹤或任何那麼有用。是否有像WEBrick錯誤一樣的堆棧跟蹤? –