sql-migrate icon indicating copy to clipboard operation
sql-migrate copied to clipboard

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

Open LuisAngelLucerosaldanaD opened this issue 4 years ago • 3 comments

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?

LuisAngelLucerosaldanaD avatar Oct 29 '20 01:10 LuisAngelLucerosaldanaD

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

bbkane avatar Dec 06 '20 02:12 bbkane

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.

Landon345 avatar Oct 27 '21 15:10 Landon345

On windows go get does not provide executable.

Build requires gcc which usually is not installed

vmato avatar Jun 02 '22 08:06 vmato