Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation errors while trying to run sample application in README.md #13

Open
arindam2 opened this issue Aug 29, 2018 · 7 comments
Open

Comments

@arindam2
Copy link

arindam2 commented Aug 29, 2018

  1. I copied the sample application into a main.go in a directory.
  2. I ran dep init -v.
  3. I ran go run main.go.

This throws the following errors:

vendor/github.com/qor/mailer/mailer.go:39:29: cannot use nil as type string in argument to render.New
vendor/github.com/qor/mailer/mailer.go:40:16: config.Render.SetAssetFS undefined (type *render.Render has no field or method SetAssetFS)
vendor/github.com/qor/mailer/template.go:46:83: mailer.Config.Render.Layout(t.Layout + ".text").Funcs(t.funcMap).Render undefined (type *render.Template has no field or method Render, but does have render.render)
vendor/github.com/qor/mailer/template.go:50:83: mailer.Config.Render.Layout(t.Layout + ".html").Funcs(t.funcMap).Render undefined (type *render.Template has no field or method Render, but does have render.render)
vendor/github.com/qor/mailer/template.go:52:82: mailer.Config.Render.Layout(t.Layout).Funcs(t.funcMap).Render undefined (type *render.Template has no field or method Render, but does have render.render)
vendor/github.com/qor/mailer/template.go:56:58: mailer.Config.Render.Funcs(t.funcMap).Render undefined (type *render.Template has no field or method Render, but does have render.render)
vendor/github.com/qor/mailer/template.go:60:58: mailer.Config.Render.Funcs(t.funcMap).Render undefined (type *render.Template has no field or method Render, but does have render.render)
vendor/github.com/qor/mailer/template.go:62:65: mailer.Config.Render.Funcs(t.funcMap).Render undefined (type *render.Template has no field or method Render, but does have render.render)
# auth/vendor/github.com/qor/session/gorilla
vendor/github.com/qor/session/gorilla/gorilla.go:26:12: undefined: utils.ContextKey

Some of the code, where nil is passed in place of integer, seems incorrect.

@arindam2
Copy link
Author

@jinzhu Could you take a look and help?

@ttpcodes
Copy link

ttpcodes commented Sep 8, 2018

I'm also encountering the issue on my end.

@KernCheh
Copy link

KernCheh commented Oct 6, 2018

@arindam2 The last release for qor/qor is on the 27th of April 2016, which is very dated. Perhaps you would have to manually override qor and all its dependencies in your Gopkg.toml file.

[[override]]
  name = "github.com/qor/qor"
  branch = "master"

@alexdor
Copy link

alexdor commented Jan 8, 2019

@arindam2 here are all the overrides and the constrains that you will need for qor admin, qor and qor auth to work:

[[constraint]]
  name = "github.com/qor/admin"
  branch = "master"

[[constraint]]
  name = "github.com/qor/qor"
  branch = "master"
[[override]]
  name = "github.com/qor/roles"
  branch = "master"
[[constraint]]
  name = "github.com/qor/auth_themes"
  branch = "master"
[[override]]
  name="github.com/qor/render"
  branch="master"
[[override]]
  name="github.com/qor/i18n"
  branch = "master"

@marceloboeira
Copy link

marceloboeira commented Jan 22, 2019

@KernCheh why can't you just use GitHub releases properly with tags? it's quite hard to point to master and be forced to update the package on every build...

@ZedYeung
Copy link

@alexdor same here, with glide, set all dependencies to branch master, still not work. How to solve?

# vendor/github.com/qor/session/gorilla
../vendor/github.com/qor/session/gorilla/gorilla.go:26:12: undefined: utils.ContextKey
# vendor/github.com/qor/render
../vendor/github.com/qor/render/render.go:69:42: undefined: utils.AppRoot
../vendor/github.com/qor/render/render.go:70:55: undefined: utils.AppRoot
../vendor/github.com/qor/render/render.go:72:28: undefined: utils.GOPATH
../vendor/github.com/qor/render/render.go:93:42: undefined: utils.AppRoot
../vendor/github.com/qor/render/render.go:94:54: undefined: utils.AppRoot
../vendor/github.com/qor/render/render.go:96:28: undefined: utils.GOPATH
exit status 2
Process exiting with code: 1

@ZedYeung
Copy link

Already fixed it, in case somebody else also uses glide, just do this.

- package: github.com/qor/auth
  version: master
- package: github.com/qor/admin
  version: master
- package: github.com/qor/render
  version: master    
- package: github.com/qor/session
  version: master   
- package: github.com/qor/auth_themes
  version: master
- package: github.com/qor/i18n
  version: master
- package: github.com/qor/roles 
  version: master
- package: github.com/qor/qor 
  version: master

And set view paths

	Auth = auth.New(&auth.Config{
		DB:        gormDB,
		ViewPaths: []string{"vendor/github.com/qor/auth/views"},
	})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants