xyu / heroku-wp

WordPress on Heroku
MIT License
869 stars 279 forks source link

bash: wp: command not found #83

Open fcristel opened 7 years ago

fcristel commented 7 years ago

Hi

I am trying to run on a Windows 10, and I get an error on installing, exactly on executing this:

heroku run wp core install \ --url=my-app-name.herokuapp.com \ --title="WordPress on Heroku" \ --admin_user="admin" \ --admin_password="correct-horse-battery-staple" \ --admin_email="info@example.com"

The error is this one:

Running wp core install ....(my app details here)..... on my-app-name... up, run.6039 (Free)
bash: wp: command not found

I have tried using CygWin, cmd.exe, git bash. Same error on all of them.

The wp.bat file path is added in my PATH variable. What else can I do?

Thank you.

jevawin commented 7 years ago

Hey @fcristel, there's an existing issue for this that was fixed but I got the same thing. I've figured out what it was for me, might be the same for you. I needed to add my SSH key to Heroku first because the Git remote is set with --ssh-git.

https://devcenter.heroku.com/articles/keys#adding-keys-to-heroku

Add your SSH key to Heroku first, then you must delete your app, delete the Git repo and re-run from scratch or you'll get errors when trying to checkout your branch.

You can delete with:

heroku apps:delete your-app-name

Then just delete the entire heroku-wp folder and follow the guide again. Hopefully this helps :-)

ryanburnette commented 7 years ago

If you're seeing bash: wp: command not found it's probably because you haven't made the initial commit which runs the build on Heroku and installs composer and wp-cli. When I ran init.sh I found myself in a branch with the name of my app which I didn't want. The init.sh tried to make "an initial commit" which I found dangerous to my repository. I started by developing locally before my first deployment. I'm not sure what the author was going for here.

I solved the issue by checkout master back out git checkout master, deleting that new branch which I didn't need git branch -D {that branch}, and making an initial commit to Heroku to run the build for the first time git push heroku master. After that it installed everything I was able to run the WordPress install command because composer and wp-cli etc were in place.