Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku: RAILS_ROOT returns app folder instead of root folder

I have this RoR app that calls to RAILS_ROOT. When running it using rails server (or when checking with ./script/console) the value contains the app's root. When deploying and running it with Heroku, however (or when checking with heroku console), the returned path is '/app'.

Why's that?

Thanks

like image 765
Miki Avatar asked Jun 19 '12 08:06

Miki


1 Answers

Because on heroku your app is in the /app folder (from the root /). It is NOT the app folder of your application, which is /app/app.

The file structure is:

/app/app/...
/app/config/..
/app/Gemfile
...

You can make an experiment.

Run heroku console and discover the file structure.

> heroku console
> puts `ls`
> puts `pwd`
like image 125
cutalion Avatar answered Oct 16 '22 20:10

cutalion