zoukankan      html  css  js  c++  java
  • beego 遇到的一些问题

    1、安装 beego 出现的问题

    今天在通过 go get -u github.com/astaxie/beego 安装 beego 应用时,出现下面问题:

    # cd .; git clone https://github.com/astaxie/beego /home/go-plugin/src/github.com/astaxie/beego
    Cloning into '/home/go-plugin/src/github.com/astaxie/beego'...
    fatal: unable to access 'https://github.com/astaxie/beego/': Peer reports incompatible or unsupported protocol version.
    package github.com/astaxie/beego: exit status 128

    根据 Peer reports incompatible or unsupported protocol version 百度是说,git版本需要升级。我将git版本升级到最新,但是还是不行,通过下面命令解决了:

    sudo yum update nss curl  # nss为名称解析和认证服务 curl为网络请求库

    初步估计为nss相关的系统文件被修改了,重新更新之后有部分nss相关的配置文件被更新过。

    看网上还有的人是报了这样的错误:

    # cd .; git clonehttps://github.com/beego/bee e:gosrcgithub.comeegoee
    Cloning into'e:gosrcgithub.comeegoee'...
    fatal: unable to access 'https://github.com/beego/bee/': Could not resolve host:github.com
    package github.com/beego/bee: exit status 128
    Could not resolve host:github.com 看含义是无法访问 https 的 github,可能跟 git 的 ssl 验证有关,于是有下面的解决方法:
    git config --global http.sslVerify false
    go get github.com/beego/bee

    这个是关闭 git 的 ssl 验证

    2、bee run 无法热编译?

    环境是通过docker搭建的,于是在编写 go 项目时也把项目文件映射在宿主主机上,即在本机上保留着真正的文件。问题来了,通过框架 beego 建立的项目,想用 bee run来进行热编译,但是无法通过,并报错:

     ERROR    ▶ 0006 Failed to build the application: go install test1: open test1: no such file or directory

    百度了下,原因是我的编程环境是 linux,beego 需要使用和 linux 本机相同的文件系统,不能使用  win 共享的文件夹,挂载到 linux,不然 bee run就识别不到文件,也无法热编译。于是再建立了一个项目,不与 win 主机映射,就可以了,不过还是会抛出错误:

    ERROR    ▶ 0019 Failed to open file on '/home/goinit/src/init1/controllers/default.go': open /home/goinit/src/init1/controllers/default.go: no such file or directory

    这个可以忽略它。(这个我觉得是使用 docker 的原因,不是原生安装的 linux 系统)

  • 相关阅读:
    numpy的文件存储 .npy .npz 文件
    Google词向量word2vec的使用
    Python函数-logging.basicConfig
    现货黄金-20180918
    Pandas的loc方法
    Pandas的index属性
    python调用exe程序
    Pandas的concat方法
    转载:为什么选择Nginx(1.2)《深入理解Nginx》(陶辉)
    discuz3.4:在Centos6.5中安装过程
  • 原文地址:https://www.cnblogs.com/linguoguo/p/8651442.html
Copyright © 2011-2022 走看看