Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find public directory. #2

Open
YUsernameNoWin opened this issue Nov 16, 2012 · 5 comments
Open

Can't find public directory. #2

YUsernameNoWin opened this issue Nov 16, 2012 · 5 comments

Comments

@YUsernameNoWin
Copy link

The public directory for loading images/assets seems not to be working and is crashing the app when deployed on heroku.

The error reported in the logs is: Error: File "./public/" does not exist. Any ideas on how to solve this? For now I don't need images so I've commented out the publish-directory call in initialize-application.

@mtravers
Copy link
Owner

Short answer: no.

Long answer: I had a terrible time trying to get all the pathnames to come
out right in the cl buildpack, and it appears that my eventual kludgy
solution is not stable over whatever changes the heroku elves are doing to
their infrastructure.

Unfortunately I don't have time to dive back into this now.

On Fri, Nov 16, 2012 at 12:16 PM, Quinn Jarrell [email protected]:

The public directory for loading images/assets seems not to be working and
is crashing the app when deployed on heroku.

The error reported in the logs is: Error: File "./public/" does not exist.
Any ideas on how to solve this? For now I don't need images so I've
commented out the publish-directory call in initialize-application.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2.

@YUsernameNoWin
Copy link
Author

Alright, I'll take a deeper look this week and see if I can fix it. Thanks for your response.

@avodonosov
Copy link

Why the error happens is obvious: the application tries to access directory the "./public/" - the one present in the git repository.

But the buildpack doesn't copy the source code to BUILD_DIR. It only places CCL binary and the application image file there. So the "./public/" directory is absent at run-time.

@avodonosov
Copy link

Found the fix. Changed the "./public/" to "/app/public".

Found this solution in this application: https://github.com/jsmpereira/heroku-cl-example.
Don't know yet how reliable it is. I.e. whether it is guaranteed by Heroku that the application sources will always be copied to slug to the directory /app/. Discussing this here: jsmpereira#2

@avodonosov
Copy link

Discuessed on #heroku at freenode.net with @jsmpereira and @yfeldblum.

We think that referring the /app/ directly is not 100% reliable, as heroku may change it in the future. Expecting the git repository content to be available in the current directory is more reliable, according to @yfeldblum.

But I've added logging to the initialization of the lips application. (ccl:current-directory) returns "/app/". Therefore it's strange "./public/" doesn't work while "/app/public/" work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants