Heroku: RAILS_ROOT returns the application folder instead of the root folder

I have this RoR application that calls RAILS_ROOT. When launched using the rails server (or when validated using ./script/console ), the value contains the root of the application. However, when you deploy and run it using Heroku (or when checking with the heroku console ), the return path is "/ app".

What for?

thanks

+7
source share
1 answer

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

File structure:

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

You can do an experiment.

Launch the hero console and find the file structure.

 > heroku console > puts `ls` > puts `pwd` 
+21
source

All Articles