Comments (3)
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.
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.
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)
- can't create project - panic: runtime error: slice bounds out of range HOT 1
- any plans on building a docker image? HOT 3
- Required Go Version HOT 2
- Editing top menu HOT 1
- It needs a basic tutorial HOT 3
- fragmenta server results in "a:unable to compile assets error:open public/assets/scripts/app-9ad47a746ac7acfa883dafa4ae0db5721bcea629.min.js: The system cannot find the path specified." HOT 7
- fragmenta: command not found HOT 2
- Incorrect datetime value for MySQL database HOT 2
- Use tags for pages, and document use
- I can't pass null value to database HOT 3
- I can't pass DML SQL commands to database HOT 2
- Support database transactions HOT 2
- Proposal: Parse JSON params in mux HOT 1
- Error copying project exec "cp" HOT 1
- Error calling go get exit status 1 HOT 1
- Handle multiple domains HOT 5
- Database user is configurable but hard-coded in migrations HOT 1
- JS Error: sel is not defined HOT 2
- Runtime editable templates feature discussion HOT 1
- uploaded file management
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fragmenta-cms.