我正在尝试使用本教程使 ReactJS 与 rails 一起工作。我收到此错误:
Uncaught ReferenceError: React is not defined
但是我可以在浏览器控制台中访问 React 对象
我还添加了public/dist/turbo-react.min.js如此处所述,并在 application.js 中添加了一行,如本答案中所述,但没有运气。此外,给出错误:
//= require components
var React = require('react')
Uncaught ReferenceError: require is not defined 
谁能建议我如何解决这个问题?
[编辑 1]
参考源代码:
这是我的comments.js.jsx文件:  
var Comment = React.createClass({
  render: function () {
    return (
      <div className="comment">
        <h2 className="commentAuthor">
          {this.props.author}
        </h2>
          {this.props.comment}
      </div>
      );
  }
});
var ready = function () {
  React.renderComponent(
    <Comment author="Richard" comment="This is a comment "/>,
    document.getElementById('comments')
  );
};
$(document).ready(ready);
这是我的index.html.erb:  
<div id="comments"></div>