程序员的资源宝库

网站首页 > gitee 正文

linux 安装beego linux 安装windows

sanyeah 2024-03-29 16:18:49 gitee 9 ℃ 0 评论

0 下载git

yum install git

1.下载go

wget https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz

2.解压go

tar zxvf go1.13.7.linux-amd64.tar.gz

3 将/usr/local/go/bin添加到环境变量中

vim /etc/profile
# 在最后一行添加
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
source /etc/profile

4. 配置 go源

打开你的终端并执行

$ export GO111MODULE=on
$ export GOPROXY=https://goproxy.cn

或者

$ echo "export GO111MODULE=on" >> ~/.profile
$ echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
$ source ~/.profile

5.vim ~/.bashrc

export GOPATH=/root/workspace/beego/ # beego的项目路径(工作目录)
export GOROOT=/usr/local/go # go的安装路径

source ~/.bashrc

 

6.用go get安装 

go get github.com/astaxie/beego

go get github.com/beego/bee


7.如果还是 bee bash: bee: command not found 请你把GOPATH/bin下的bee.exe 拷贝到 GOROOT/bin里面,也就是你的go语言环境变量的bin里面,然后运行 bee

 

8. 创建项目

bee new demo1

9.go: cannot find main module; see 'go help modules' 2022/07/26 19:54:17 ERROR    ? 0003 Failed to bui

这个错误 在 项目目录下 执行  

go mod init

 

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表