I think that it depends on the goals of the service object. If it were only internal interactions then this would make sense. However, if the issue was an error with an external api that you've wrapped your service object around, I would probably prefer this method.
That is indeed very strange! I just reprovisioned my development environment this morning and tested this with the latest Rails and devise. It is happening to me too! I'm guessing that when the generator is being ran, it is injecting the RAILS_ENV as an attribute and devise is picking it up somehow... Really weird!
Using this works without adding in the weird ENV
```
gem 'devise'
run 'bundle install'
generate(:scaffold, 'user', 'name')
generate('devise:install')
generate('devise','User')
```
I've entered an issue on Github regarding this issue. It is definitely unexpected behavior. However, I don't know how critical it is since there is a workaround.
https://github.com/plataformatec/devise/issues/4992