gobuffalo / cli

The Buffalo CLI
19 stars 24 forks source link

no sqlite support of homebrew release? #14

Closed tcurdt closed 3 years ago

tcurdt commented 4 years ago

Description

Since I had problem with an existing project I thought I try a new one.

Steps to Reproduce the Problem

$ brew install gobuffalo/tap/buffalo
$ buffalo new coke --skip-yarn --skip-webpack --db-type sqlite3
Usage:
  buffalo new [name] [flags]

Flags:
      --api                  skip all front-end code and configure for an API server
      --ci-provider string   specify the type of ci file you would like buffalo to generate [none, travis, gitlab-ci] (default "none")
      --config string        config file (default is $HOME/.buffalo.yaml)
      --db-type string       specify the type of database you want to use [cockroach, mariadb, mysql, postgres] (default "postgres")
      --docker string        specify the type of Docker file to generate [none, multi, standard] (default "multi")
  -d, --dry-run              dry run
  -f, --force                delete and remake if the app already exists
  -h, --help                 help for new
      --module string        specify the root module (package) name. [defaults to 'automatic']
      --skip-config          skips using the config file
      --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

ERRO[0001] Error: unknown dialect "sqlite3" expecting one of cockroach, mariadb, mysql, postgres 

Expected Behavior

It should generate the app skeleton.

Actual Behavior

It seems like the homebrew release does not come with sqlite support.

Info

``` $ buffalo info -> Go: Checking installation ✓ The `go` executable was found on your system at: /usr/local/bin/go -> Go: Checking minimum version requirements ✓ Your version of Go, 1.13.6, meets the minimum requirements. -> Go: Checking Package Management ⚠ You do not appear to be using Go Modules. * Go Modules (Recommended) - https://gobuffalo.io/en/docs/gomods For help setting up your Go environment please follow the instructions for you platform at: https://www.gopherguides.com/courses/preparing-your-environment-for-go-development -> Go: Checking PATH ✓ Your PATH contains /Users/tcurdt/go/bin. -> Node: Checking installation ✓ The `node` executable was found on your system at: /usr/local/bin/node -> Node: Checking minimum version requirements ✓ Your version of Node, v13.7.0, meets the minimum requirements. -> NPM: Checking installation ✓ The `npm` executable was found on your system at: /usr/local/bin/npm -> NPM: Checking minimum version requirements ✓ Your version of NPM, 6.13.6, meets the minimum requirements. -> Yarn: Checking installation ✓ The `yarnpkg` executable was found on your system at: /usr/local/bin/yarnpkg -> Yarn: Checking minimum version requirements ✓ Your version of Yarn, 1.21.1, meets the minimum requirements. -> PostgreSQL: Checking installation ✘ The `postgres` executable could not be found on your system. For help setting up your Postgres environment please follow the instructions for you platform at: https://www.postgresql.org/download/ -> MySQL: Checking installation ✘ The `mysql` executable could not be found on your system. For help setting up your MySQL environment please follow the instructions for you platform at: https://www.mysql.com/downloads/ -> SQLite3: Checking installation ✓ The `sqlite3` executable was found on your system at: /usr/bin/sqlite3 -> SQLite3: Checking minimum version requirements ✓ Your version of SQLite3, 3.28.0, meets the minimum requirements. -> Cockroach: Checking installation ✘ The `cockroach` executable could not be found on your system. For help setting up your Cockroach environment please follow the instructions for you platform at: https://www.cockroachlabs.com/docs/stable/ -> Buffalo (CLI): Checking installation ✓ The `buffalo` executable was found on your system at: /usr/local/bin/buffalo -> Buffalo (CLI): Checking minimum version requirements ✓ Your version of Buffalo (CLI), v0.15.4, meets the minimum requirements. -> Buffalo: Application Details Pwd /Users/tcurdt/Downloads Root /Users/tcurdt/Downloads GoPath /Users/tcurdt/go PackagePkg Downloads ActionsPkg Downloads/actions ModelsPkg Downloads/models GriftsPkg Downloads/grifts WithModules true Name Downloads Bin bin/Downloads VCS WithPop false WithSQLite false WithDep false WithWebpack false WithNodeJs false WithYarn false WithDocker false WithGrifts false AsWeb true AsAPI false InApp false PackageJSON {map[]} ```
w3irdrobot commented 4 years ago

I had this same issue. It appears that the Homebrew version doesn't ship with the sqlite support. You need to install buffalo using go get instead, which is documented in the buffalo docs. However, doing it this way wasn't installing the buffalo binary in my PATH. Turns out this was because I didn't have GO111MODULE set to on. I had it on auto, which I believe is the current default. So here are the steps I ran to get it working.

brew uninstall gobuffalo/tap/pop
brew uninstall gobuffalo/tap/buffalo
echo "export GO111MODULE=on" >> ~/.bashrc
. ~/.bashrc
go get -u -v -tags sqlite github.com/gobuffalo/buffalo/buffalo
# if you want the soda CLI as well, run the following...
# go get -u -v -tags sqlite github.com/gobuffalo/pop/...
# go install -tags sqlite github.com/gobuffalo/pop/soda
tcurdt commented 4 years ago

I was under the impression GO111MODULE is no longer required - interesting. But either way - this should be fixed in the docs.

And the homebrew version should either come with sqlite by default or allow for a build flag.

w3irdrobot commented 4 years ago

Yeah I didn't think it was required either. 🤷‍♂

Yeah the Homebrew formula should probably be updated, but it looks like the formula is just downloading prebuilt binaries. None of the prebuilt binaries on Github have sqlite3 support, at least it doesn't look like it with how they are labelled. So the binaries they supply would probably need to be updated as well.

williamdavid900 commented 4 years ago

I too set the GO111MODULE=0 in my .bashrc before running "go get":

go get -u -v -tags sqlite github.com/gobuffalo/buffalo/buffalo

Without setting GO111MODULE=0, the above go command issues dozens of errors in the terminal output. With the GO111MODULE=0 the above command didn't give a single error.

Then when I do:

buffalo new myapp --db-type sqlite

I get this error:

ERRO[0000] Error: unknown dialect "sqlite" expecting one of cockroach, mariadb, mysql, postgres

I thought sqlite was supported. I followed the installation instructions for including sqlite. Obviously I'm misunderstanding something.

Thanks for any insight you can provide, Bill

version Info

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 5 days with no activity.