lang

Revel Frameworkd for Golang

C/H 2019. 2. 6. 08:30

Install revel frameword for go

go get github.com/revel/revel
	go get github.com/revel/cmd/revel
	#revel help
	revel
	Usage:
	  revel [OPTIONS] <command>
	
	Application Options:
	  /v, /debug               If set the logger is set to verbose
		  /historic-run-mode   If set the runmode is passed a string not json
	  /X, /build-flags:        These flags will be used when building the application. May be specified multiple times, only applicable for Build, Run, Package, Test commands
	
	Available commands:
	  build
	  clean
	  new
	  package
	  run
	  test
	  version
	
	revel version
	Revel executing: displays the Revel Framework and Go version
	WARN  16:41:53 version.go:240: Unable to extract version information from Revel library error,err=nil LOG15_ERROR="Normalized odd number of arguments by adding nil"
	Revel Framework :       Unknown (0.21.0 remote master branch)
	Revel Cmd       :       0.21.1  (0.21.1 remote master branch)
	Revel Modules   :       Unknown (0.21.0 remote master branch)
	
	go version go1.11.4 windows/amd64
	

install blog

revel new goblog
	Revel executing: create a skeleton Revel application
	Your application has been created in:
		C:\Users\username\Projects\go\src\goblog
	
	You can run it with:
		revel run -a  goblog
		revel new goblog
		Revel executing: create a skeleton Revel application
		Your application has been created in:
			C:\Users\username\Projects\go\src\goblog
		
		You can run it with:
			revel run -a  goblog
					   
	

Run Web Server

# conf/app.conf
		# The port on which to listen.
		http.port = 9000
	
revel run -a goblog

Check http://localhost:9000

에러

revel run -a goblog
	Revel executing: run a Revel application
	Error stack [utils.go:109 command_config.go:232 revel_container.go:90 revel_container.go:231 revel_container.go:191 run.go:129 revel.go:109 proc.go:201 asm_amd64.s:1333]
	ERROR 17:40:57 command_config.go:233: Failed to import package                 error="exit status 1" gopath=C:\\Users\\username\\Projects\\go GO-ROOT=C:\\Users\\username\\scoop\\apps\\go\\current output="# cd C:\\Users\\username\\Projects\\g
	o\\src\\github.com\\revel\\modules; git pull --ff-only\nfatal: Not a git repository (or any of the parent directories): .git\npackage github.com/revel/modules/static: exit status 128\n"
	ERROR 17:40:57  revel.go:110: Unable to execute                        error="Revel paths[error Failed to load module.  Import of path failed modulePath:github.com/revel/modules/static error:cannot find package \"github.com/revel/mo
	dules/static\" in any of:\n\tC:\\Users\\username\\scoop\\apps\\go\\current\\src\\github.com\\revel\\modules\\static (from $GOROOT)\n\tC:\\Users\\username\\Projects\\go\\src\\github.com\\revel\\modules\\static (from $GOPATH) ]"
	

window10 go get 으로 revel을 설치하면 아래 에러가 발생한다.
subsystem ubuntu에서 sudo apt install golang-go 을 설치 후
export GOPATH=/mnt/c/GOPATH 를 설정
export PATH=$PATH:$GOPATH/bin 설정
src/github.cm/revel 폴더를 삭제 후
go get 으로 revel과 cmd/revel을 다시 설치후
revel run -a goblog 실행하면 정상 동작한다.


반응형

'lang' 카테고리의 다른 글

Hello World for Go  (0) 2019.02.05
IDEs for Go  (0) 2019.02.04
Phantomjs - hello World  (0) 2019.01.28
Golang windows path  (0) 2019.01.15
GetText 로컬라이즈 방법, ko.po, ko.mo  (0) 2016.12.30