joy-framework / joy

A full stack web framework written in janet
https://joy.swlkr.com
MIT License
537 stars 30 forks source link

Cannot install Mac OS #49

Closed jackcallister closed 4 years ago

jackcallister commented 4 years ago

Hello, I have an issue with installation vis jpm - here are the last few lines of the output:

Installed as 'tester'.
copying src/tester.janet to /usr/local/Cellar/janet/1.9.0/lib/janet...
From https://github.com/joy-framework/dotenv
 * branch            master     -> FETCH_HEAD
Already up-to-date.
no dependencies found
removing /usr/local/Cellar/janet/1.9.0/lib/janet/dotenv.janet
removing /usr/local/Cellar/janet/1.9.0/lib/janet/.manifests/dotenv.jdn
Uninstalled.
generating /usr/local/Cellar/janet/1.9.0/lib/janet/.manifests/dotenv.jdn...
Installed as 'dotenv'.
copying dotenv.janet to /usr/local/Cellar/janet/1.9.0/lib/janet...
removing /usr/local/bin/joy
Error building git repository dependency: No such file or directory: /usr/local/bin/joy
swlkr commented 4 years ago

Hm, I’ve been running into this too.

I know this is a hack, but if you touch /usr/local/bin/joy and then uninstall/reinstall it should work.

I’m still trying to figure out how to fix this 😑

swlkr commented 4 years ago

I believe what was causing this was my 💩code in project.janet which tried to symlink joy to /usr/local/bin I've updated joy so this doesn't happen anymore.

Probably not what you wanted to see, but I solved this by deleting janet entirely:

brew uninstall janet (in my case), then reinstalling then calling jpm install joy

hweeks commented 4 years ago

The solution I had was to create the three files it looks for. I don't think this is a joy thing, i think it's a jpm thing. jpm appears to try and delete and if the file can't be found throws an error. That behaviour might be wrong in these situations. For reference:

touch /usr/local/bin/joy && touch /usr/local/lib/janet/joy && touch /usr/local/lib/janet/joy.janet
hweeks commented 4 years ago

I also ended up with an issue with my db install and manually cloned the repo and had to do that same clean up steps for it to install manually. If you want to isolate this stuff easily I put a good clean Dockerfile together to run in isolation:

FROM alpine:3.7
RUN apk add --no-cache build-base curl git

RUN cd /tmp && \
    git clone https://github.com/janet-lang/janet.git && \
    cd janet && \
    make all test install && \
    rm -rf /tmp/janet

RUN jpm install joy

WORKDIR /var/app
RUN joy server

Assuming you mount your local dir into the remote. This has the obvious issue of no restarts on file change, but I'd like to work on getting that feature in.

swlkr commented 4 years ago

Yeah I'm all for adding an official Dockerfile to the repo! Submit a PR and I'll merge it asap

swlkr commented 4 years ago

I'm going to close this since it's been a while with no activity. And also... docker 🐟