alexey.verkhovsky@gmail.com
2007-Feb-11 08:10 UTC
Let''s make RAILS_ROOT an absolute path on Windows
As this Caboose article [] suggests, I am not the only one who had this problem. RAILS_ROOT is a relative path on Windows, and it can bite you in unexpected ways. I had that problem while working on CruiseControl.rb. There is a trivial patch fixing it (by simply applying File.expand_path to the path before assigning it into the RAILS_ROOT constant): http://dev.rubyonrails.org/ticket/7259 Best regards, Alex Verkhovsky --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Alexey Verkhovsky
2007-Feb-11 08:21 UTC
Re: Let''s make RAILS_ROOT an absolute path on Windows
On 2/11/07, alexey.verkhovsky@gmail.com <alexey.verkhovsky@gmail.com> wrote:> > As this Caboose article [] suggestsOops, the missing link was http://i.nfectio.us/articles/2007/02/10/rails_root-and-dir-chdir --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2007-Feb-11 22:55 UTC
Re: Let''s make RAILS_ROOT an absolute path on Windows
expand_path doesn''t play nice with symlinks, so RAILS_ROOT will be set to deploy_dir/releases/9374789394 instead of /current. What in particular is breaking your application? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Alexey Verkhovsky
2007-Feb-12 02:35 UTC
Re: Let''s make RAILS_ROOT an absolute path on Windows
On 2/11/07, Michael Koziarski <michael@koziarski.com> wrote:> > > expand_path doesn''t play nice with symlinks, so RAILS_ROOT will be set > to deploy_dir/releases/9374789394 instead of /current.Right. Thanks for reminding me. We had exact same conversation two years ago, and I completely forgot about it by now. Rails autoloading, and Kernel.require in general, breaks when you chdir into another directory after executing config/environment.rb. chdir invalidates all $: entries added by Rails, because all of them start from (relative) RAILS_ROOT. You typically need to change the current working directory before executing external processes. A workaround is to wrap every shell command within its own chdir block. It''s not too hard to do, just hard to remember. Best regards, Alex --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Nicholas Seckar
2007-Feb-12 02:50 UTC
Re: Let''s make RAILS_ROOT an absolute path on Windows
I''d also like to switch to realpath instead of cleanpath... On 2/11/07, Alexey Verkhovsky <alexey.verkhovsky@gmail.com> wrote:> On 2/11/07, alexey.verkhovsky@gmail.com <alexey.verkhovsky@gmail.com> wrote: > > > > As this Caboose article [] suggests > > > Oops, the missing link was > http://i.nfectio.us/articles/2007/02/10/rails_root-and-dir-chdir > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---