markbates / grift

Go based task runner
MIT License
432 stars 24 forks source link

grifter/main.go:4:8 cannot find package #9

Closed dilumn closed 7 years ago

dilumn commented 7 years ago

I tried to integrate grift to my buffalo project.

After installing grift by go get github.com/markbates/grift

Still it's showing me -bash: grift: command not found . I have created GOPATH correctly. buffalo command is working fine.

And also if I run grift inside my buffalo project, it shows me this error.

.grifter/main.go:4:8: cannot find package "Users/dilumnavanjana/Documents/Singapore/big-api/grifts" in any of:
    /usr/local/go/src/Users/dilumnavanjana/Documents/project (from $GOROOT)
    /Users/dilumnavanjana/go/src/Users/dilumnavanjana/Documents/project/grifts (from $GOPATH)

The GOPATH I configured is /Users/dilumnavanjana/go, here it's showing a wrong GOPATH.

What is the reason for all these??

markbates commented 7 years ago

It sounds like you have a couple of issues. First, if it can't find the grift command it's because you haven't added $GOPATH/bin to your $PATH. Here are some instructions on how to make sure you have your environment setup properly. http://gopherguides.com/before-you-come-to-class

The second issue is you are trying to work outside of your Go workspace. All Go code must live inside $GOPATH/src. If you look at the second set of error messages I can see that your current directory isn't inside your Go workspace by the fact it doesn't have a src folder in it.

dilumn commented 7 years ago

Thank you for this explanation & I was able to fix my issue. That issue was not something to do with grifter.

markbates commented 7 years ago

Awesome. Glad to hear you got it working.