improve rvmrc handling, fix #1521