2017-09-24 149 views
0

我的rails應用程序使用react-rails,並將我的項目部署到Heroku。併成功完成。但是我無法連接Heroku上的項目。它顯示錯誤頁面。所以我查了一下heroku的日誌。部署到Heroku時有錯誤

2017-09-23T15:11:19.654651+00:00 app[web.1]: Started GET "/" for 31.200.230.123 at 2017-09-23 15:11:19 +0000 
2017-09-23T15:11:19.710323+00:00 app[web.1]: Processing by DashboardsController#show as HTML 
2017-09-23T15:11:20.013683+00:00 heroku[router]: at=info method=GET path="/" host=rockcms.herokuapp.com request_id=5c8bebb0-fc0b-4af3-8721-006a1f9829d1 fwd="31.200.230.123" dyno=web.1 connect=1ms service=366ms status=500 bytes=1733 protocol=https 
2017-09-23T15:11:20.002369+00:00 app[web.1]: Completed 500 Internal Server Error in 292ms 
2017-09-23T15:11:20.008529+00:00 app[web.1]: ExecJS::ProgramError (ReferenceError: React is not defined): 
2017-09-23T15:11:20.011167+00:00 app[web.1]: (execjs):35:12442 
2017-09-23T15:11:20.011168+00:00 app[web.1]: (execjs):43:14 

而且我認爲,錯誤是由於反應而發生的。我需要正確的建議。 如果你需要一些信息,我會給他們看。

謝謝!

+0

是它在當地的環境中工作??? – krishnar

+0

是的,它工作正常 – Andrey

回答

0

導入這些上面的文件在您的反應代碼駐留

import React from "react"; 
import ReactDOM from "react-dom"; 
+0

我已經將代碼添加到所有使用反應的文件。但同樣的錯誤:( – Andrey

0

要麼需要進口上面陳述或者您需要執行NPM安裝在生產服務器上

+0

其實,我沒有在項目中的package.json文件。該項目包括react-rails(https://github.com/reactjs/react-rails)gem。 – Andrey