Giter VIP home page Giter VIP logo

Comments (3)

kennygrant avatar kennygrant commented on August 22, 2024

Hi, GOPATH is intended to be the place where all your go projects live, it takes a little getting used to, but it would be worth looking at this article for ref:

https://golang.org/doc/code.html

GOPATH should contain -

bin for binaries
pkg for build artefacts
src for source code (which can be many projects, and is arranged be repo url).

So, your GOPATH should probably be /home/manhattan/work/ or /home/manhattan/go or something lilke that, and should be set in your .profile file or similar (see instructions above).

Then to make a site, cd to that directory, and use fragmenta new cms github.com/manhattan/mysitename

or something like that (as long as it is in GOPATH src, it doesn't matter so much what the path is). Now within that project dir you'll then find a bin (for server binaries, src for src etc), and your import paths should be of the form "github.com/manhattan/mysitename/src/users" and "github.com/manhattan/mysitename/src/lib/authorise" (so relative to GOPATH). If that is breaking for you though, let me know the command you used to create a new site. It does attempt to take into account GOPATH and expects your sites to be within GOPATH/src, so if they are not it might break. I suspect that is what happened here?

I do need to make this friendlier and issue a warning, a certain amount of Go setup is assumed at the minute, which is probably a bad assumption. At some point I'll be supplying one binary instead, so that you can just run the CMS without bothering with a go install, but I'm not quite at that point yet, and you might want to tinker anyway.

from fragmenta-cms.

aliabadi avatar aliabadi commented on August 22, 2024

Well, I realized part of what was going wrong last nite; I did get the cms to work, but only in development mode.

/home/manhattan is actually where I set my GOPATH (it's a dedicated workspace/project user).

To run the cms the command would actually be fragmenta-cms it seems. It seems to run fine if FRAG_ENV is not set....but now when I try to set FRAG_ENV=production it doesn't want to load.

Here's pretty much what I did to get it working in development mode:

go get github.com/fragmenta
export PATH=$PATH:~/bin
export GOPATH=/home/manhattan
fragmenta new cms frag
cd frag
fragmenta migrate
fragmenta-cms

If I run fragmenta test it gives the same cannot import absolute path error, but from all the source files when it tries to run the tests.

I also just tried running the above site creation process (just changing the psql user's password instead of migrate) from ~/src/ but the same thing happens.

I'm sure I can now search the code and find where the FRAG_ENV modifies things & tinker with it from here, but any insights are appreciated. =]

Thanks!

from fragmenta-cms.

kennygrant avatar kennygrant commented on August 22, 2024

I think the issue is that you've made your frag dir in /home/manhattan/frag - with Go setup you should have ended up with:

/home/manhattan/bin
/home/manhattan/pkg
/home/manhattan/src

then your project should be at something like this (assuming you want to use the 'frag' dir to put it in):

/home/manhattan/src/frag

which will in turn contain a bin,log,public,src etc for the app itself.

I really need to explain this better in the docs, but assumed people would have set up go fully and have a gopath functioning first. So try setting up your go path as above (with bin/src/pkg dirs), and create a new cms inside /home/manhattan/src/frag, and it should work.

from fragmenta-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.