Miki
Miki

Reputation: 469

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

Upvotes: 11

Views: 3355

Answers (1)

cutalion
cutalion

Reputation: 4394

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`

Upvotes: 28

Related Questions