set correct rails env

- sets RAILS_ENV only if it is empty
- sorry for indentation changes, they are done by my vim hooks