gpt4 book ai didi

golang fork exec 错误 - gobuffalo

转载 作者:IT王子 更新时间:2023-10-29 01:47:03 24 4
gpt4 key购买 nike

我刚开始尝试创建一些基本的 gobuffalo 应用程序,但我一直遇到 fork/exec 错误,例如

ERRO[0000] 错误:fork/exec/usr/local/bin/buffalo: exec 格式错误

我的 buffalo 应用程序当前位于目录中:

~/projects/golang/src/github.com/buffalo_experiments/coke

我尝试重命名 buffalo_experiments 文件夹以匹配我的操作系统 usr,即 clementoh 但它没有任何用处。

有人可以向我解释一下这是怎么回事吗?我认为是因为这个错误......当我运行时没有生成迁移文件:

buffalo g 资源用户名 email bio:nulls.Text

完整标准输出

      create  actions/users.go
create actions/users_test.go
create locales/users.en-us.yaml
create templates/users/_form.html
create templates/users/edit.html
create templates/users/index.html
create templates/users/new.html
create templates/users/show.html
run buffalo db g model user name email bio:nulls.Text
run goimports -w actions/actions_test.go actions/app.go actions/home.go actions/home_test.go actions/render.go actions/users.go actions/users_test.go grifts/db.go grifts/init.go main.go models/models.go models/models_test.go
Usage:
buffalo generate resource [name] [flags]

Aliases:
resource, r

Examples:
$ buffalo g resource users
Generates:

- actions/users.go
- actions/users_test.go
- models/user.go
- models/user_test.go
- migrations/2016020216301234_create_users.up.fizz
- migrations/2016020216301234_create_users.down.fizz

$ buffalo g resource users --skip-migration
Generates:

- actions/users.go
- actions/users_test.go
- models/user.go
- models/user_test.go

$ buffalo g resource users --skip-model
Generates:

- actions/users.go
- actions/users_test.go

$ buffalo g resource users --use-model users
Generates:

- actions/users.go
- actions/users_test.go

Flags:
-h, --help help for resource
-n, --name string allows to define a different model name for the resource being generated.
-s, --skip-migration tells resource generator not-to add model migration
--skip-model tells resource generator not to generate model nor migrations
--skip-templates tells resource generator not to generate templates for the resource
--use-model string tells resource generator to reference an existing model in generated code

ERRO[0000] Error: fork/exec /usr/local/bin/buffalo: exec format error

最佳答案

我遇到了同样的问题:)您可能使用了错误的 buffalo 二进制文件 /usr/local/bin/buffalo。它应该是位于 $GOPATH 中的二进制文件。例如:$GOPATH/bin/buffalo

关于golang fork exec 错误 - gobuffalo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49569385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com