# All rails scripts running slow -- require\_frameworks() probl

**URL:** <https://www.ruby-forum.com/t/all-rails-scripts-running-slow-require-frameworks-probl/134775>\
**Category:** Rails\
**Created:** [April 14, 2008, 11:22pm UTC](https://www.ruby-forum.com/t/all-rails-scripts-running-slow-require-frameworks-probl/134775 "2008-04-14T23:22:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orange73](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ce7236/32.png) [@orange73](https://www.ruby-forum.com/u/orange73)\
**Post date:** [April 14, 2008, 11:22pm UTC](https://www.ruby-forum.com/t/all-rails-scripts-running-slow-require-frameworks-probl/134775/1 "2008-04-14T23:22:31Z")

</div>

I’m using InstantRails to build my rails app. Anytime i try to run a  
rails script (the two i usually run are `ruby script/server webrick` and  
`ruby script/runner 'Mailer.check_mail'` (an ActionMailer to check a  
GMail account over IMAP and retrieve messages). I have profiled both of  
these applications with Ruby Performance Validator, and they are both  
spending like 98% of the time at require\_frameworks(). I can see that  
as being acceptable for webrick, but why would the mailer script be  
running so slow, especially after I have webrick (and the associated  
frameworks) loaded and running?

I have tried messing around with setting RUBYOPT=rubygems, but that  
doesn’t seem to help.

I am on a windows box running Ruby 1.8.6, Rails 2.0.2. Any help would  
be appreciated!

---

<div class="post-metadata">

**Author:** ![orange73](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ce7236/32.png) [@orange73](https://www.ruby-forum.com/u/orange73)\
**Post date:** [April 14, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/all-rails-scripts-running-slow-require-frameworks-probl/134775/2 "2008-04-14T23:56:40Z")

</div>

On Apr 14, 10:22 pm, Orange 73 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’m using InstantRails to build my rails app. Anytime i try to run a  
> rails script (the two i usually run are `ruby script/server webrick` and  
> `ruby script/runner 'Mailer.check_mail'` (an ActionMailer to check a  
> GMail account over IMAP and retrieve messages). I have profiled both of  
> these applications with Ruby Performance Validator, and they are both  
> spending like 98% of the time at require\_frameworks(). I can see that  
> as being acceptable for webrick, but why would the mailer script be  
> running so slow, especially after I have webrick (and the associated  
> frameworks) loaded and running?

script/runner loads the entire framework (it’s kind of the point of  
it) so it’s never going to be lightening fast. If you’re going to be  
running the script often you may be better off with a long running  
process rather than thrashing around reloading rails every 30 seconds.

Fred
