2

I wanted to play with the Beego webframework. A simple command in the shell can setup a new project directory. If I run the following commandin Window's Powershell I get an error, because the command is unknown:

bee new beego_project

How can I register this command to make use of it?

user3147268
  • 1,814
  • 7
  • 26
  • 39

1 Answers1

2

Make sure your environment variables are correctly set in your Powershell setup.
See for instance "how to modify GOPATH in powershell"

  • GOPATH needs to be set
  • %GOPAHT%\bin needs to be added to the PATH and bee must be in that folder.

Note that you can set those variables in your %USERPROFILE%\Documents\WindowsPowerShell\Profile.ps1, which is similar to a ~\.bashrc.

The OP adds in the comments:

I just needed to add %GOPATH%\bin to the %PATH% variable.
Now it works also under %GOPATH%

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • The %GOPATH% and %GOPATH%/bin paths working fine. The weird thing is, that I can do the following, if I'm in the %GOPATH%/src folder: => ` ..\bin\bee new project_name` <= Bee.exe is present but I can't call it, if I'm located in %GOPATH%. **Stackoverflow doesn't seem to use my formating** – user3147268 Feb 06 '15 at 18:31
  • "bee is present but I can't call it": do you mean you get the same error message, even when you do a `..\bin\bee bew project_name` from `%GOPATH%\src`? Or is it working in that specific case? – VonC Feb 06 '15 at 20:14
  • I can create a beego project with the shown command inside the /src dir but **can't** do it under %GOPATH%. The error message says, a cmdlet with the name bee can't be found. – user3147268 Feb 06 '15 at 20:25
  • @user3147268 that looks like a command discovery issue (as in http://powershell.cz/2012/12/07/last-modified-date-brainteaser/, mentioned from http://stackoverflow.com/a/19579529/6309). In your Powershell session, does your `%PATH%` includes `%GOPATH%\bin`? – VonC Feb 06 '15 at 20:49
  • I just needed to add %GOPATH%\bin to the %PATH% variable. Now it works also under %GOPATH%. Thanks for your help ;) – user3147268 Feb 06 '15 at 20:55
  • @user3147268 Great! I have included your comment in the answer for more visibility. – VonC Feb 06 '15 at 20:56