# Environment initialize block - Kernel.load problems

**URL:** <https://www.ruby-forum.com/t/environment-initialize-block-kernel-load-problems/130941>\
**Category:** Rails\
**Created:** [March 4, 2008, 5:39pm UTC](https://www.ruby-forum.com/t/environment-initialize-block-kernel-load-problems/130941 "2008-03-04T17:39:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [March 4, 2008, 5:39pm UTC](https://www.ruby-forum.com/t/environment-initialize-block-kernel-load-problems/130941/1 "2008-03-04T17:39:59Z")

</div>

Hi,

I’m trying to load a file into my environment, so it can use the  
instance variable “config”, the block parameter within the initialize  
call. I can’ seem to get the file to load, so that it has access to  
“config”. I’ve tried:

Kernel.load File.join(RAILS\_ROOT, ‘lib’, ‘boot.rb’, false)  
load File.join(RAILS\_ROOT, ‘lib’, ‘boot.rb’, false)

But the config variable is not available within the ‘boot.rb’ file.  
What gives?

Matt

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [March 4, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/environment-initialize-block-kernel-load-problems/130941/2 "2008-03-04T19:48:19Z")

</div>

On 4 Mar 2008, at 16:28, matt mitchell wrote:

> But the config variable is not available within the ‘boot.rb’ file.  
> What gives?

It’s a local variable not an instance variable, so you wouldn’t expect  
a file loaded like that to be able to see it.

Fred
