Rails.logger is nil when invoking rake tasks

Good morning everybody,

is it expected for the Rails.logger to be left uninitialized before executing a rake task?

These are the steps to reproduce my test: https://gist.github.com/olistik/9068351

Thanks

With a task like that, the rails environment is not loaded, so I wouldn’t expect much in the way of rails to be setup. If you set your task to depend on the :environment task then Rails should be setup for you.

Fred

Thanks, I’ve updated the gist :slight_smile: