gobuffalo / docs

The source for the Buffalo website
https://gobuffalo.io
MIT License
112 stars 153 forks source link

Generating API project #275

Closed jcarley closed 6 years ago

jcarley commented 6 years ago

Go 1.10.3 Buffalo 0.12.3

$ buffalo new exampleapi --api --ci-provider gitlab-ci
      create  .buffalo.dev.yml
      create  models/models.go
      create  models/models_test.go
      create  grifts/db.go
         run  go get github.com/gobuffalo/pop/...
      create  ./database.yml
         run  goimports -w ccmsapi/grifts/db.go ccmsapi/models/models.go ccmsapi/models/models_test.go
      create  Dockerfile
      create  .dockerignore
      create  .env
      create  grifts/init.go
      create  actions/actions_test.go
      create  actions/render.go
      create  fixtures/sample.toml
      create  inflections.json
      create  main.go
      create  actions/home.go
      create  actions/app.go
      create  .codeclimate.yml
      create  README.md
      create  actions/home_test.go
      create  .gitlab-ci.yml
         run  go get -t ./...
# github.com/gobuffalo/buffalo
../../../../gobuffalo/buffalo/app.go:54:10: a.router.MethodNotAllowedHandler undefined (type *mux.Router has no field or method MethodNotAllowedHandler)
Usage:
  buffalo new [name] [flags]

Flags:
      --api                  skip all front-end code and configure for an API server
      --bootstrap int        specify version for Bootstrap [3, 4] (default 4)
      --ci-provider string   specify the type of ci file you would like buffalo to generate [none, travis, gitlab-ci] (default "none")
      --db-type string       specify the type of database you want to use [postgres, mysql, cockroach] (default "postgres")
      --docker string        specify the type of Docker file to generate [none, multi, standard] (default "multi")
  -f, --force                delete and remake if the app already exists
  -h, --help                 help for new
      --skip-pop             skips adding pop/soda to your app
      --skip-webpack         skips adding Webpack to your app
      --skip-yarn            use npm instead of yarn for frontend dependencies management
      --vcs string           specify the Version control system you would like to use [none, git, bzr] (default "git")
  -v, --verbose              verbosely print out the go get commands
      --with-dep             adds github.com/golang/dep to your app

ERRO[0001] Error: exit status 2
markbates commented 6 years ago

It sounds like your gorilla mux package might be corrupt. https://godoc.org/github.com/gorilla/mux#Router try deleting that package from your GOPATH and trying again.

jcarley commented 6 years ago

🤦‍♂️ That worked. Sorry. Didn't even think about trying that. I know what happened now. Does Go have an environment manager like python or ruby?

markbates commented 6 years ago

lol no worries. And the answer is there are a ton of 3rd party ones, but they’re all terrible. . :( Use dep for package management. It’s bundler for go