fukiki commented on a change in pull request #3282:
URL: https://github.com/apache/apisix/pull/3282#discussion_r557092774



##########
File path: doc/how-to-build.md
##########
@@ -109,6 +109,49 @@ Makefile rules:
 Environment variable can be used to configure APISIX. Please take a look at 
`conf/config.yaml` to
 see how to do it.
 
+### Troubleshooting
+**Compile and install luasocket**
+
+If you run `make init` or `make run` to get an issue `Symbol not found: 
_luaL_openlib`, make sure to use the right version of luaSocket and lua. You 
can change lua 5.3.5 using LuaJIT or lua 5.1, if it still doesn't work, you can 
manually compile and install luasocket.
+
+- Download the source code to compile and install luasocket.
+
+```sh
+git clone https://github.com/diegonehab/luasocket.git
+make 
+make install 
+```
+
+If you get error as below:
+
+```
+/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src linux
+/Applications/Xcode.app/Contents/Developer/usr/bin/make all-unix PLAT=linux
+gcc  -I/usr/include/lua/5.1 -I/usr/include/lua5.1 -DLUASOCKET_NODEBUG -Wall 
-Wshadow -Wextra -Wimplicit -O2 -ggdb3 -fpic   -c -o luasocket.o luasocket.c
+In file included from luasocket.c:15:
+./luasocket.h:27:10: fatal error: 'lua.h' file not found
+#include "lua.h"
+         ^~~~~~~
+1 error generated.
+make[2]: *** [luasocket.o] Error 1
+make[1]: *** [linux] Error 2
+make: *** [linux] Error 2
+```
+
+Lua.h file was not found at compile time, installed in the system is lua 
5.3.5_1, modify the compiler parameters:

Review comment:
       Using Lua 5.3.5 is just for compile luasocket, not for the apisix




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to