# Rake tasks + plugins

**URL:** <https://www.ruby-forum.com/t/rake-tasks-plugins/149597>\
**Category:** Rails\
**Created:** [September 26, 2008, 5:43pm UTC](https://www.ruby-forum.com/t/rake-tasks-plugins/149597 "2008-09-26T17:43:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@alexey](https://www.ruby-forum.com/u/alexey)\
**Post date:** [September 26, 2008, 5:43pm UTC](https://www.ruby-forum.com/t/rake-tasks-plugins/149597/1 "2008-09-26T17:43:42Z")

</div>

In my rake task I try to use the classes and methods defined in a  
plugin.  
Seems that plugins are not hooked up during the rake task run.

Models are also not hooked up.

I can require ‘ModelName’  
I can require ‘activerecord’

But my Model depends a lot on the plugin (globalize) and initiation of  
the whole globalize plugin in the .rake file would be a mess.

What is the simplest way to hook up the whole environment during the  
rake task?

---

<div class="post-metadata">

**Author:** ![alexey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@alexey](https://www.ruby-forum.com/u/alexey)\
**Post date:** [September 26, 2008, 5:44pm UTC](https://www.ruby-forum.com/t/rake-tasks-plugins/149597/2 "2008-09-26T17:44:54Z")

</div>

On Sep 26, 4:13 pm, Alexey S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What is the simplest way to hook up the whole environment during the  
> rake task?

Make your task depend on the :environment task.

Fred

---

<div class="post-metadata">

**Author:** ![alexey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@alexey](https://www.ruby-forum.com/u/alexey)\
**Post date:** [September 26, 2008, 6:14pm UTC](https://www.ruby-forum.com/t/rake-tasks-plugins/149597/3 "2008-09-26T18:14:55Z")

</div>

Thank you very much!

On 26 óÅÐÔ, 18:44, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
