# Using Rails config /load path/etc from external app

**URL:** <https://www.ruby-forum.com/t/using-rails-config-load-path-etc-from-external-app/81586>\
**Category:** Rails\
**Created:** [January 10, 2007, 10:10am UTC](https://www.ruby-forum.com/t/using-rails-config-load-path-etc-from-external-app/81586 "2007-01-10T10:10:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [January 10, 2007, 10:10am UTC](https://www.ruby-forum.com/t/using-rails-config-load-path-etc-from-external-app/81586/1 "2007-01-10T10:10:48Z")

</div>

Kind of an off the wall question but I want to use the config / load  
path [for models specifically] in an external app that essentially loads  
the database for my rails app [there’s transformations, processing  
involved, i.e. fixtures won’t help here] - it true DYI spirit, could  
anyone suggest a way to effectively use the models/config in a seperate  
script without having to restate them? I checked in the Rail Initializer  
but didn’t have much luck…

Thanks

---

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [January 10, 2007, 1:22pm UTC](https://www.ruby-forum.com/t/using-rails-config-load-path-etc-from-external-app/81586/2 "2007-01-10T13:22:34Z")

</div>

Brez! !! wrote:

> Kind of an off the wall question but I want to use the config / load  
> path [for models specifically] in an external app that essentially loads  
> the database for my rails app [there’s transformations, processing  
> involved, i.e. fixtures won’t help here] - it true DYI spirit, could  
> anyone suggest a way to effectively use the models/config in a seperate  
> script without having to restate them? I checked in the Rail Initializer  
> but didn’t have much luck…
> 
> Thanks

script/runner ‘load “db/fill\_user\_table.rb”’

Normally script/runner just executes the code passed to it, pass it a  
file to execute. I think this will work.

---

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [January 10, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/using-rails-config-load-path-etc-from-external-app/81586/3 "2007-01-10T20:13:59Z")

</div>

> script/runner ‘load “db/fill\_user\_table.rb”’
> 
> Normally script/runner just executes the code passed to it, pass it a  
> file to execute. I think this will work.

Works like a charm - thanks…
