I''m attempting to add a path to my rails app by adding the line : config.load_paths += %W( #{RAILS_ROOT}/new_path ) to my config/environments/development.rb file. For some reason rails doesn''t seem to be picking up the module located in this path, however when I add that same line to my config/environment.rb file the module loads up fine. I am definitely running under the dev environment and i am editing the correct rb file as far as I can tell. Any ideas? Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ed wrote:> I''m attempting to add a path to my rails app by adding the line : > config.load_paths += %W( #{RAILS_ROOT}/new_path ) > to my config/environments/development.rb file. For some reason rails > doesn''t seem to be picking up the module located in this path, however > when I add that same line to my config/environment.rb file the module > loads up fine. I am definitely running under the dev environment and i > am editing the correct rb file as far as I can tell. Any ideas? > > Thanks.I don''t think you can use an environment-specific initializer. The initializer defined in environment.rb is run before any environment-specific code. See http://toolmantim.com/article/2006/12/27/environments_and_the_rails_initialisation_process, the section titled "Rails::Initializer.run and per-environment configs". -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I see. Let me explain what I''m trying to do any maybe you have some advice. I''ve got two ruby modules that have the same name and same functionality but are implemented differently. I''d like one of them to be loaded by ruby depending on the environment. I don''t want to make any changes to config/ environment.rb and would like to keep environment specific changes confined to config/ environments/*.rb. What should I be doing to accomplish this? Thanks a lot. On Jan 9, 5:03 pm, Jeremy Weiskotten <rails-mailing-l...@andreas- s.net> wrote:> Ed wrote: > > I''m attempting to add a path to my rails app by adding the line : > > config.load_paths += %W( #{RAILS_ROOT}/new_path ) > > to my config/environments/development.rb file. For some reason rails > > doesn''t seem to be picking up the module located in this path, however > > when I add that same line to my config/environment.rb file the module > > loads up fine. I am definitely running under the dev environment and i > > am editing the correct rb file as far as I can tell. Any ideas? > > > Thanks. > > I don''t think you can use an environment-specific initializer. The > initializer defined in environment.rb is run before any > environment-specific code. > > Seehttp://toolmantim.com/article/2006/12/27/environments_and_the_rails_i..., > the section titled "Rails::Initializer.run and per-environment configs". > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I see. Let me explain what I''m trying to do any maybe you have some advice. I''ve got two ruby modules that have the same name and same functionality but are implemented differently. I''d like one of them to be loaded by ruby depending on the environment. I don''t want to make any changes to config/environment.rb and would like to keep environment specific changes confined to config/environments/*.rb. What should I be doing to accomplish this? Thanks a lot. On Jan 9, 5:03 pm, Jeremy Weiskotten <rails-mailing-l...@andreas- s.net> wrote:> Ed wrote: > > I''m attempting to add a path to my rails app by adding the line : > > config.load_paths += %W( #{RAILS_ROOT}/new_path ) > > to my config/environments/development.rb file. For some reason rails > > doesn''t seem to be picking up the module located in this path, however > > when I add that same line to my config/environment.rb file the module > > loads up fine. I am definitely running under the dev environment and i > > am editing the correct rb file as far as I can tell. Any ideas? > > > Thanks. > > I don''t think you can use an environment-specific initializer. The > initializer defined in environment.rb is run before any > environment-specific code. > > Seehttp://toolmantim.com/article/2006/12/27/environments_and_the_rails_i..., > the section titled "Rails::Initializer.run and per-environment configs". > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---