Port some commits from 2.3 because of bug
https://github.com/redmine/redmine/commit/df0b91e2383811cf0987fc65d6bcb8b63541ab2d
https://github.com/redmine/redmine/commit/4c6dfdf95fcb1ae4b014ea595d1f6d5bad64eb48
Add rvm configs to ignore.