# RAILS\_ROOT is not a directory error

**URL:** <https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729>\
**Category:** Rails\
**Created:** [August 24, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729 "2008-08-24T20:20:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 24, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729/1 "2008-08-24T20:20:18Z")

</div>

Hi all,

Im attempting to deploy a third party rails application at the moment  
and im coming up against the following error:

RAILS\_ROOT is not a directory

This is used in boot.rb in the following lines:

unless defined?(RAILS\_ROOT)  
root\_path = File.join(File.dirname( **FILE** ), ‘…’)

unless RUBY\_PLATFORM =~ /mswin32/  
require ‘pathname’  
root\_path = Pathname.new(root\_path).cleanpath(true).to\_s  
end

end

I’ve tried changing permissions and ownership for the directory in  
question but it doesnt seem to help my cause.

Any ideas on how this might be solved?

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 24, 2008, 10:12pm UTC](https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729/2 "2008-08-24T22:12:16Z")

</div>

Hi Chris,

Chris G. wrote:

> unless RUBY\_PLATFORM =~ /mswin32/  
> require ‘pathname’  
> root\_path = Pathname.new(root\_path).cleanpath(true).to\_s  
> end
> 
> end

RAILS\_ROOT is not a directory. It’s a string. Which line is throwing  
the  
error?

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 24, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729/3 "2008-08-24T22:15:15Z")

</div>

Hi Bill,

its not a directory but isnt it a line referencing a directory?

the full error can be seen here:

> **[Chris Gallagher](https://chris-gallagher.com/)**
>
> Instructional Design and Development

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 25, 2008, 2:24pm UTC](https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729/4 "2008-08-25T14:24:31Z")

</div>

Ryan B. wrote:

> I see no such file to load… config/environment.

Me too.

> On 25/08/2008, at 5:45 AM, Chris G. wrote:
> 
> > Hi Bill,
> > 
> > its not a directory but isnt it a line referencing a directory?

It’s a string that _could_ be a path. I’d use logger to see exactly  
what it  
is when the error is thrown. OTOH… IIRC, I didn’t see anything in the  
code that would throw the error you said was being thrown.

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 25, 2008, 2:31am UTC](https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729/5 "2008-08-25T02:31:29Z")

</div>

I see no such file to load… config/environment.

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [November 15, 2008, 4:23am UTC](https://www.ruby-forum.com/t/rails-root-is-not-a-directory-error/146729/6 "2008-11-15T04:23:53Z")

</div>

I ran into this same issue ‘RAILS\_ROOT is not a directory error’ and  
it turned out to be a permission issue on files in my config folder.

Thanks.

On Aug 24, 11:20 am, Chris G. \<rails-mailing-l…@andreas-
