lapis icon indicating copy to clipboard operation
lapis copied to clipboard

OSX: can not find suitable server installation

Open mylesbarros opened this issue 8 years ago • 12 comments

I'm attempting to setup lapis for the first time but I'm running into an issue with lapis' server dependancies. Specifically I'm getting the typical "can not find suitable server installation" when running the lapis command which prevents me from running lapis server.

I installed openresty through homebrew

mylesbarros$ which openresty
/usr/local/bin/openresty

I've also tried installing nginx directly and setting up a symlink directly in /usr/local out of desperation to no avail.

Where is lapis looking for openresty and what can I do to get it to recognize my installation?

mylesbarros avatar Apr 19 '16 17:04 mylesbarros

Lapis looks in the following:

"/usr/local/openresty/nginx/sbin/"
"/usr/local/opt/openresty/bin/"
"/usr/sbin/"
"" (this one represents your PATH)

source

TangentFoxy avatar Apr 19 '16 17:04 TangentFoxy

I have to be missing something obvious as, even using the export command to add openresty to my PATH, lapis still isn't able to identify the server.

Is there a manual for setting lapis up that might help clarify the issue?

mylesbarros avatar Apr 19 '16 18:04 mylesbarros

Other than the one I linked to, I do not know. I'd say read that entire page (and maybe the homepage of Lapis) carefully to see that you aren't missing a step.

TangentFoxy avatar Apr 19 '16 19:04 TangentFoxy

Got it working!

For anyone that has experienced a similar issue I uninstalled the Homebrew install of openresty and instead built it from source and installed it via make.

Haven't the slightest suggestion as to why the Homebrew install was incompatible with lapis.

mylesbarros avatar Apr 19 '16 19:04 mylesbarros

Glad you got it working. ^^ I'd like to add that from my (admittedly limited) experience, that seems to be the best way to go about it.

TangentFoxy avatar Apr 19 '16 19:04 TangentFoxy

Thanks, and thanks for the input!

There's definitely a reason that you default to it, I should probably pick up the habit.

mylesbarros avatar Apr 19 '16 19:04 mylesbarros

What path does homebrew install to? Maybe I can add it to one of the default search paths

leafo avatar Apr 22 '16 01:04 leafo

@leafo homebrew installs everything to its own directory and symlinks it all into /usr/local/bin by default.

TangentFoxy avatar Apr 22 '16 06:04 TangentFoxy

Also the easy way to install it on any os — Docker I used this image https://hub.docker.com/r/erikcw/lapis/ and it was like 1-2-3

romanesko avatar May 25 '16 09:05 romanesko

So, it seems that lapis is only looking for a binary w/ the name nginx. The default homebrew openresty version (from denji/homebrew-nginx) puts openresty in /usr/local/opt/openresty. But, the binary is only named openresty, not nginx.

ln -s /usr/local/opt/openresty/bin/openresty /usr/local/opt/openresty/bin/nginx

Allows lapis to boot the server.

cycomachead avatar Jan 28 '18 10:01 cycomachead

@cycomachead

You can use the LAPIS_OPENRESTY environment varibale to set the location of the openresty binary, but the symbolic link approach works too.

https://github.com/leafo/lapis/blob/master/lapis/cmd/nginx.moon#L91

leafo avatar Jan 28 '18 18:01 leafo

Ah, thanks!

Do you think it's worth looking for / using binaries named openresty? That'd make the default mac OS install easier.

cycomachead avatar Jan 29 '18 05:01 cycomachead