For a recent project, I had several views with code like this:
<% if @users.count == 0 %>
This worked fine in development mode ... I turned it into prod mode and it exploded, saying that the counter is not a valid Array method. I changed each instance to use the length of Array # and it seems to work.
1) What is the reason for this difference in behavior?
2) Are there any other interesting differences between the dev and prod modes that I should follow?
MORAL: make sure your production hosting environment uses the same version of Ruby as your local development environment. :)
thanks
Tom
ruby ruby-on-rails
cakeforcerberus
source share