# Updating running ruby scripts

**URL:** <https://www.ruby-forum.com/t/updating-running-ruby-scripts/107674>\
**Category:** Ruby\
**Created:** [June 25, 2007, 7:33am UTC](https://www.ruby-forum.com/t/updating-running-ruby-scripts/107674 "2007-06-25T07:33:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [June 25, 2007, 7:33am UTC](https://www.ruby-forum.com/t/updating-running-ruby-scripts/107674/1 "2007-06-25T07:33:55Z")

</div>

Hi,  
I’ve got a few small ruby scripts that run every 15 minutes or so from  
cron that do processing from a database. I was wondering if it is  
dangerous to update these programs (basically an svn update) while they  
are running. They don’t read any files while they are running, just  
work off a db. I guess this isnt a Ruby question per say, but basically  
my question is, is the entire ruby script loaded into memory when it  
launches? So any change to the rb file itself wouldn’t affect the  
program until it was launched again?

Thanks,  
Ray

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [June 25, 2007, 7:40am UTC](https://www.ruby-forum.com/t/updating-running-ruby-scripts/107674/2 "2007-06-25T07:40:11Z")

</div>

Raymond O’Connor wrote:

> work off a db. I guess this isnt a Ruby question per say, but basically  
> my question is, is the entire ruby script loaded into memory when it  
> launches?

AFAIK, the entire Ruby file is parsed into an AST before any of it is  
evaluated. However, if your script is split up into multiple files, I  
imagine there could be a .001% race condition where Ruby loads an  
impartially-updated code base.

(Note: The preceding email was written by a team of intoxicated monkeys,  
and may not be in any way true.)
