且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查整个 rails 项目的编译错误

更新时间:2023-12-05 11:45:10

Ruby 是一种解释型语言.没有编译步骤.在编写代码之前,请遵循 TDD 并编写测试.

Ruby is an interpreted language. There is no compilation step. Please follow TDD and write your tests before you write your code.

更新:由于此答案已被接受,除非 OP 接受另一个答案,否则我无法删除它,但人们通过 Google 搜索登陆此处,请参阅其他答案.这与其说是回答,不如说是口齿伶俐.Ruby 社区有很棒的工具可以像 Rubocop 和朋友一样进行各种静态代码分析.至少,ruby -c 将完成 OP 想要的.

UPDATE: Since this answer was accepted, I can't delete it unless the OP accepts another answer but people landing here through Google search, please see the other answers. This was more of a tongue in cheek remark than an answer. Ruby community has wonderful tools for doing all kinds of static code analysis like Rubocop and friends. At the bare minimum, ruby -c will accomplish what the OP wanted.