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

"sql-migrate" is not recognized as an internal or external command, executable program or batch file. #183

Open
LuisAngelLucerosaldanaD opened this issue Oct 29, 2020 · 3 comments

Comments

@LuisAngelLucerosaldanaD

i'm programing in windows and when I execute answer me with "sql-migrate" is not recognized as an internal or external command,
executable program or batch file.
how should I set the environment variable in windows?

@bbkane
Copy link
Contributor

bbkane commented Dec 6, 2020

I can't test this (I'm on a Mac), but try the following:

Get GOPATH:

go env GOPATH

You should be able to open the folder listed and see a folder called bin. Check that sql-migrate (or maybe sql-migrate.exe is in the bin folder. If it's not there, you most likely didn't install it correctly.

Add the full path to the bin folder (I'm on MacOS, so my path looks like /Users/bbkane/go/bin -ou're on Windows, so yours will look different) to your PATH environmental variable with these instructions

@Landon345
Copy link

Landon345 commented Oct 27, 2021

Even on my Mac, I was running into this issue. For me, since I use zsh for my terminal, I had to run:

code ~/.zshrc

Then put this line in the file:

export PATH="$PATH:/Users/landonschlangen/go/bin"

Once I did so, the sql-migrate command finally started working.

@vmato
Copy link

vmato commented Jun 2, 2022

On windows go get does not provide executable.

Build requires gcc which usually is not installed

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

4 participants