英文:
Why still says no GOPATH though i've set it?
问题
以下是翻译好的内容:
无论是GoSublime
还是vim-go
都告诉我GOPATH
没有设置,但是我已经设置了。
我的~/.bashrc
文件内容如下:
export GOPATH=$HOME/gopath
export PATH="$PATH:$GOPATH/bin"
我可以使用go get
命令将gocode安装到~/gopath/bin
目录下,
但是它输出了以下内容:...:/home/myusrname/gopath/bin: No such file or directory
对于~$ $PATH
命令。
英文:
Both GoSublime
and vim-go
tells me that GOPATH
isn't set, however I've already done this.
my ~/.bashrc
:
export GOPATH=$HOME/gopath
export PATH="$PATH:$GOPATH/bin"
and I can use go get
to install gocode to my ~/gopath/bin
but it prints that: ...:/home/myusrname/gopath/bin: No such file or directory
for
~$ $PATH
答案1
得分: 1
$PATH
是尝试执行你的 $PATH
字符串,也就是将 $PATH
变量的内容写入控制台并按下回车键。这导致了你看到的错误。
你想要的是:
~$ echo $PATH
英文:
~$ $PATH
is trying to execute your $PATH
string, i.e. it's equivalent to writing the contents of the $PATH
variable into the console and pressing enter. That results in the error you're seeing.
What you want is
~$ echo $PATH
答案2
得分: 0
终于搞定了:我必须通过设置$GOPATH在shell中打开gvim!
英文:
finally i got it: i have to open gvim through shell with $GOPATH set - -!
答案3
得分: 0
你可以尝试使用以下命令启动 gvim:
bash -lc gvim
这将使用你的 .bashrc 文件中的设置启动 gvim。
这个信息来自于 https://github.com/fatih/vim-go/issues/468。
英文:
You can try to start gvim with the command:
bash -lc gvim
It then starts gvim with the settings in your .bashrc file.
This is from https://github.com/fatih/vim-go/issues/468
答案4
得分: 0
在我的情况下,我在我的.profile文件中添加了GOPATH。
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
然后重新启动我的Ubuntu 16.04。
接下来,为了安装vim-go插件,我在gvim中使用以下命令:
:GoInstallBinaries
英文:
In my case, I added GOPATH in my .profile
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
And restart my Unbuntu 16.04
Then for my vim-go, I installed the vim-go by the following command in gvim
:GoInstallBinaries
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论