In my app controller I require a file named "configuration.rb" in the config directory like so require "config/configuration" This has been working perfectly fine in Rails 2 in all environments including prod. Having migrated to Rails 3 this works in all environments if I run "rails server" without the daemon option. If I run the server with the daemon option (-d), I get the following error: "no such file to load -- config/configuration" I have tried various things including changing the require to: require Rails.root.join("config/configuration") But that only changes the error message to: "Missing helper file helpers/config/configuration.rb" Any help would be appreciated. Thanks Mathias -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Wouldn''t it be easier to move this to config/initializers/ your_file.rb ? Therefore Your file would be automatically loaded every time when You fire up an rails server. On 14 Lis, 21:07, mr <mathias.rich...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> In my app controller I require a file named "configuration.rb" in the > config directory like so > > require "config/configuration" > > This has been working perfectly fine in Rails 2 in all environments > including prod. Having migrated to Rails 3 this works in all > environments if I run "rails server" without the daemon option. If I > run the server with the daemon option (-d), I get the following error: > > "no such file to load -- config/configuration" > > I have tried various things including changing the require to: > > require Rails.root.join("config/configuration") > > But that only changes the error message to: > > "Missing helper file helpers/config/configuration.rb" > > Any help would be appreciated. > > Thanks > > Mathias-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks for your answer. The option of moving this source file somewhere Rails 3 will find it is kind of a last resort for me. What gets me with this issue is that without the daemon option this works (the required file is found) whereas with the daemon option it doesn''t work... On 15 Nov., 09:11, Marcin Seroczynski <sere...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Wouldn''t it be easier to move this to config/initializers/ > your_file.rb ? > > Therefore Your file would be automatically loaded every time when You > fire up an rails server. > > On 14 Lis, 21:07, mr <mathias.rich...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > In my app controller I require a file named "configuration.rb" in the > > config directory like so > > > require "config/configuration" > > > This has been working perfectly fine in Rails 2 in all environments > > including prod. Having migrated to Rails 3 this works in all > > environments if I run "rails server" without the daemon option. If I > > run the server with the daemon option (-d), I get the following error: > > > "no such file to load -- config/configuration" > > > I have tried various things including changing the require to: > > > require Rails.root.join("config/configuration") > > > But that only changes the error message to: > > > "Missing helper file helpers/config/configuration.rb" > > > Any help would be appreciated. > > > Thanks > > > Mathias-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Please quote when replying. mr wrote in post #961520:> Thanks for your answer. The option of moving this source file > somewhere Rails 3 will find it is kind of a last resort for me.In this case, it''s not a last resort. Config files (if they''re automatically loaded) normally go in config/initializers; if you put it elsewhere, that was probably a mistake. So fix the mistake.> > What gets me with this issue is that without the daemon option this > works (the required file is found) whereas with the daemon option it > doesn''t work...That is strange. Is $: the same in both cases? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I moved the file and it resolved the issue. But still, why would it work without -d but not with -d. Everything else remains the same... On 15 Nov., 15:45, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Please quote when replying. > > mr wrote in post #961520: > > > Thanks for your answer. The option of moving this source file > > somewhere Rails 3 will find it is kind of a last resort for me. > > In this case, it''s not a last resort. Config files (if they''re > automatically loaded) normally go in config/initializers; if you put it > elsewhere, that was probably a mistake. So fix the mistake. > > > > > What gets me with this issue is that without the daemon option this > > works (the required file is found) whereas with the daemon option it > > doesn''t work... > > That is strange. Is $: the same in both cases? > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- <b> tag in HTML 5 (was Re: Re: assert_select for <p><b>text</b>value</p>)
- Equipment_URL Failed to Generate (new_equipment_path)
- Using Ruby on Rails to edit a script?
- Rails - escape_javascript without all the \n\n\n\n\n
- Anything special needed to migrate test::unit tests from Rails 2x to Rails3?