无法从 Go 安装 Revel 框架

我试图安装Revel Framework。我按照文档中给出的所有步骤进行操作,但每当我尝试运行 Revel 命令时,它都会抛出恐慌错误。以下是我正在执行环境路径的步骤:


export GOROOT=/usr/local/go

export GOPATH=/Users/<username>/Desktop/gocode

export PATH="/Users/<username>/gocode/bin:$PATH"

安装 Revel


go get github.com/revel/revel

go get github.com/revel/cmd/revel

export PATH="$PATH:$GOPATH/bin"

当我运行狂欢版本时,它显示:


panic: runtime error: slice bounds out of range


goroutine 1 [running]:

github.com/revel/cmd/model.(*CommandConfig).UpdateImportPath(0xc4200961c0, 0x20)

    /Users/amitsharma/Desktop/gocode/src/github.com/revel/cmd/model/command_config.go:122 +0x907

main.main()

    /Users/amitsharma/Desktop/gocode/src/github.com/revel/cmd/revel/revel.go:133 +0x243

当我跑步时


revel run -a my-app

表明


ERROR 19:34:59 harness.go:231: Could not start application              error="revel/harness: app died reason: exit status 2"

INFO  19:34:59 watcher.go:272: Watcher: Recording error last build, setting rebuild on error="App failed to start up: revel/harness: app died reason: exit status 2"

INFO  19:34:59 watcher.go:277: Rebuilt, result                          error="App failed to start up: revel/harness: app died reason: exit status 2"

我的去版本


go version go1.10.3 darwin/amd64

我的环境

GOARCH="amd64"

GOBIN=""

GOCACHE="/Users/amitsharma/Library/Caches/go-build"

GOEXE=""

GOHOSTARCH="amd64"

GOHOSTOS="darwin"

GOOS="darwin"

GOPATH="/Users/<username>/Desktop/gocode"

GORACE=""

GOROOT="/usr/local/go"

GOTMPDIR=""

GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"

GCCGO="gccgo"

CC="clang"

CXX="clang++"

CGO_ENABLED="1"

CGO_CFLAGS="-g -O2"

CGO_CPPFLAGS=""

CGO_CXXFLAGS="-g -O2"

CGO_FFLAGS="-g -O2"

CGO_LDFLAGS="-g -O2"

PKG_CONFIG="pkg-config"

GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0d/pkfrs5cj0v57xgsnwvb2kb580000gn/T/go-build028697826=/tmp/go-build -gno-record-gcc-switches -fno-common"


慕容708150
浏览 148回答 1
1回答

拉莫斯之舞

尝试重新安装狂欢这是我尝试过的方法,它对我有用。设置执行路径($GOPATH):export&nbsp;GOPATH=/var/projects/go安装狂欢和命令:&nbsp;&nbsp;go&nbsp;get&nbsp;github.com/revel/revel&nbsp;&nbsp;go&nbsp;get&nbsp;github.com/revel/cmd/revel将 revel cmd 链接到 bin 目录。因此该命令可能是可执行的。export&nbsp;PATH="$PATH:$GOPATH/bin检查狂欢是否有效。revel只需在命令行中输入输出会是这样的&nbsp; Usage:&nbsp; &nbsp; &nbsp; revel [OPTIONS] <command>&nbsp; &nbsp; Application Options:&nbsp; &nbsp; &nbsp; -v, --debug&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If set the logger is set to verbose&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --historic-run-mode&nbsp; If set the runmode is passed a string not json&nbsp; &nbsp; &nbsp; -X, --build-flags=&nbsp; &nbsp; &nbsp; &nbsp;These flags will be used when building the application. May be specified multiple times, only applicable for Build, Run,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Package, Test commands&nbsp; &nbsp; Available commands:&nbsp; &nbsp; &nbsp; build&nbsp; &nbsp; &nbsp; clean&nbsp; &nbsp; &nbsp; new&nbsp; &nbsp; &nbsp; package&nbsp; &nbsp; &nbsp; run&nbsp; &nbsp; &nbsp; test&nbsp; &nbsp; &nbsp; version检查狂欢版本:revel version输出&nbsp; &nbsp; Revel executing: displays the Revel Framework and Go version&nbsp; &nbsp; Revel Framework :&nbsp; &nbsp;0.21.0&nbsp; (0.21.0 remote master branch)&nbsp; &nbsp; Revel Cmd&nbsp; &nbsp;:&nbsp; &nbsp;0.21.1&nbsp; (0.21.1 remote master branch)&nbsp; &nbsp; Revel Modules&nbsp; &nbsp;:&nbsp; &nbsp;0.21.0&nbsp; (0.21.0 remote master branch)现在,您可以使用命令创建第一个项目revel new myapp输出&nbsp; &nbsp; Revel executing: create a skeleton Revel application&nbsp; &nbsp; Your application has been created in:&nbsp; &nbsp; &nbsp; &nbsp;/var/projects/go/src/myapp&nbsp; &nbsp; You can run it with:&nbsp; &nbsp; revel run -a&nbsp; myapp
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go