Himberjack
Himberjack

Reputation: 5802

How to check rails compilation before deployment

I encounter sometimes a broken code that if I run rails c/s locally it doesn't break. Only after deployment (RAILS_ENV = production) it will break on rails server loading...

Before deployment I do RAILS_ENV=production rails s to see if it breaks or not.

Is there a way to test this differently?

Thanks

Upvotes: 0

Views: 213

Answers (2)

Tim
Tim

Reputation: 1005

OK, I've got a couple of suggestions - in terms of whether the code is syntactically correct, I'd refer you to this post:

How to check entire rails project for compilation errors - note that the accepted answer defers to other answers.

One biggie, that I dislike is asset pipeline, as the artifacts are intentially different in production than in development. I'd suggest this.

Rails asset pipeline tests pass production broken

Apart from that, https://github.com/yorickpeterse/ruby-lint/ is interesting, for analysis, and the errors list it generates might be of interest.

Upvotes: 2

Log checking in the production is the best way. Check in log which class or method breaks the code you might able to find the bug.

Upvotes: 0

Related Questions