I recommend that you also use a web application scanner like OWASP ZAP and something to scan your dependencies for known vulnerabilities (e.g., bundle audit or GitHub's scanner).
That is in addition to normal software development tools like a style checker (like Rubocop) and a test suite with good coverage (e.g., minitest).
If you develop software, it's going to get attacked. There are some pretty straightforward ways to help resist attacks, but you have to use them.