2017-09-24 175 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