heroku / heroku-local

this code is now in https://github.com/heroku/cli
ISC License
21 stars 13 forks source link

why am i getting an error for heroku local web - f Procfile.windows ? #25

Open netisheth opened 8 years ago

netisheth commented 8 years ago

Hi, I am new to Heroku and I just started with their first tutorial Getting Started on Heroku with Java. I could implement all the steps successfully but i can't run the app locally. The build was successful.

C:\Users\my\Documents\GitHub\java-getting-started [master ≡]> heroku local web - f Procfile.windows

[OKAY] Loaded ENV .env File as KEY=VALUE Format [WARN] ENOENT: no such file or directory, open 'C:\Users\my\Documents\GitHub\jav a-getting-started\Procfile.windows' [FAIL] No Procfile and no package.json file found in Current Directory - See her oku local --help

Can someone please help me with it? Thank you in advance.

jdx commented 8 years ago

does the Procfile exist in that location?

netisheth commented 8 years ago

Yes it's there.

jdx commented 8 years ago

heroku local is just a wrapper for node-foreman: https://github.com/strongloop/node-foreman

maybe see if you can use node-foreman directly to rule out whether or not this is an issue with heroku local.

wparrkerr commented 8 years ago

I was experiencing a very similar error while trying to deploy my first app, which is written in python using the Flask framework.

I got the same failure message upon running heroku local, although I had a different [WARN] message(these warnings are just warnings though and aren't crashing heroku local):

[FAIL] No Procfile and no package.json file found in Current Directory - See her oku local --help

It turns out that I had incorrect syntax in my Procfile, and instead of saying the syntax in the Procfile was wrong, the error was just saying it can't find a procfile at all.

Specifics, in case they help

the command I run my app with is: gunicorn app:app

My Incorrect Procfile was: web gunicorn app:app

I was missing a colon after 'web', as the syntax is <process type>:<command>. Changing the Procfile fixed the problem: web: gunicorn app:app

Your situation is probably different. I would say just ensure your Procfile syntax is spot on, because apparently heroku local won't recognize the Procfile even exists if the syntax is incorrect.

grantathon commented 7 years ago

I did this and I still get the error. I've been trying to figure this out all day, but nothing. If I run "heroku local", it complains with the "[FAIL] No Procfile and no package.json file found in Current Directory - See run.js --help" error. If I run "heroku local web", it complains with this:

return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^

Error: EACCES: permission denied, open '.env' at Object.fs.openSync (fs.js:584:18) at Object.fs.readFileSync (fs.js:491:33) at loadEnvsFile (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/lib/envs.js:133:15) at Array.map (native) at loadEnvs (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/lib/envs.js:148:30) at Command. (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/nf.js:72:16) at Command.listener (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/commander/index.js:301:8) at emitTwo (events.js:106:13) at Command.emit (events.js:194:7) at Command.parseArgs (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/commander/index.js:615:12)

Please help!

jdx commented 7 years ago

you're probably not in the right directory

grantathon commented 7 years ago

I have it in the same directory level as the project and app directories where manage.py is located, which I believe is correct.

grantathon commented 7 years ago

I've confirmed the same thing happens with the original heroku django template found here: https://github.com/heroku/heroku-django-template.

WojciechThomas commented 7 years ago

You have not built your application locally and that is the reason you receive an error: there is no app startup script called from Procfile.windows.

To resolve the problem just run: sbt compile stage and voila... now you can run your app locally.

marokac commented 6 years ago

i made a java rest api and is hosted nicely on heroku but some of the services says application error and also slow what could be the problem