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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-04 18:47 UTC
Re: environment initialize block - Kernel.load problems
On 4 Mar 2008, at 16:28, matt mitchell wrote:> > 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? >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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---