Rails.logger is nil when invoking rake tasks

253 views
Skip to first unread message

maurizio de magnis

unread,
Feb 18, 2014, 5:35:26 AM2/18/14
to rubyonra...@googlegroups.com
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

Frederick Cheung

unread,
Feb 18, 2014, 5:51:54 AM2/18/14
to rubyonra...@googlegroups.com
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

maurizio de magnis

unread,
Feb 18, 2014, 5:59:04 AM2/18/14
to rubyonra...@googlegroups.com
Thanks, I've updated the gist :-)

Reply all
Reply to author
Forward
0 new messages