11

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

4

1 回答 1

27

因为在 heroku 上,您的应用程序位于/app文件夹中(从根目录/)。它不是您的应用程序的 app 文件夹,即/app/app.

文件结构为:

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

你可以做一个实验。

运行 heroku 控制台并发现文件结构。

> heroku console
> puts `ls`
> puts `pwd`
于 2012-06-19T15:12:05.870 回答