Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac m1 brew install:module 'kong.cmd.init' not found:No LuaRocks module #7705

Closed
wuyachao opened this issue Aug 12, 2021 · 9 comments · Fixed by Kong/homebrew-kong#185
Closed
Labels
distribution task/needs-investigation Requires investigation and reproduction before classifying it as a bug or not.

Comments

@wuyachao
Copy link

Steps To Reproduce

  1. install
    brew tap kong/kong
    brew install kong
Error: Failed installing dependency: https://luarocks.org/lyaml-6.2.7-1.src.rock - Could not find library file for YAML
  No file libyaml.a in /usr/local/lib
  No file libyaml.dylib in /usr/local/lib
  No file matching libyaml.so.* in /usr/local/lib
  No file libyaml.a in /usr/lib
  No file libyaml.dylib in /usr/lib
  No file matching libyaml.so.* in /usr/lib
  No file libyaml.a in /lib
  No file libyaml.dylib in /lib
  No file matching libyaml.so.* in /lib

2.luarocks install lyaml

Error: Could not find library file for YAML
  No file libyaml.a in /usr/local/lib
  No file libyaml.dylib in /usr/local/lib
  No file matching libyaml.so.* in /usr/local/lib

3.brew info libyaml
/opt/homebrew/Cellar/libyaml/0.2.5

4.luarocks install lyaml YAML_LIBDIR=/opt/homebrew/Cellar/libyaml/0.2.5/lib/ YAML_INCDIR=/opt/homebrew/Cellar/libyaml/0.2.5/include/
lyaml 6.2.7-1 is now installed in /opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks
5.brew install kong ,also error:No file libyaml.a in /usr/local/lib
so i do it:
ln -s /opt/homebrew/Cellar/libyaml/0.2.5/lib/* /usr/local/lib

6.brew install kong, it's success.

==> Installing kong from kong/kong
==> Downloading https://download.konghq.com/gateway-src/kong-2.5.0.tar.gz
Already downloaded: /Users/wuyachao/Library/Caches/Homebrew/downloads/2f8ba8914e27f26f25f76ebd16a3453474274690b35bee36621f0cde3a373335--kong-2.5.0.tar.gz
==> Patching
==> /opt/homebrew/opt/openresty@1.19.3.2/luarocks/bin/luarocks --tree=/opt/homebrew/Cellar/kong/2.5.0 make CRYPTO_DIR=/opt/homebrew/opt/openresty@1.19.3.2/openssl OPENS
🍺  /opt/homebrew/Cellar/kong/2.5.0: 1,221 files, 10.0MB, built in 1 minute 30 seconds

Additional Details & Logs

kong version:

kong version
ERROR: /opt/homebrew/bin/kong:9: module 'kong.cmd.init' not found:No LuaRocks module found for kong.cmd.init
no field package.preload['kong.cmd.init']
no file './kong/cmd/init.lua'
no file './kong/cmd/init/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/site/lualib/kong/cmd/init.ljbc'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/site/lualib/kong/cmd/init/init.ljbc'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/lualib/kong/cmd/init.ljbc'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/lualib/kong/cmd/init/init.ljbc'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/site/lualib/kong/cmd/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/site/lualib/kong/cmd/init/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/lualib/kong/cmd/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/lualib/kong/cmd/init/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks/share/lua/5.1/kong/cmd/init.lua'
no file './kong/cmd/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/luajit/share/luajit-2.1.0-beta3/kong/cmd/init.lua'
no file '/usr/local/share/lua/5.1/kong/cmd/init.lua'
no file '/usr/local/share/lua/5.1/kong/cmd/init/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/luajit/share/lua/5.1/kong/cmd/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/luajit/share/lua/5.1/kong/cmd/init/init.lua'
no file '/Users/wuyachao/.luarocks/share/lua/5.1/kong/cmd/init.lua'
no file '/Users/wuyachao/.luarocks/share/lua/5.1/kong/cmd/init/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks/share/lua/5.1/kong/cmd/init/init.lua'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/site/lualib/kong/cmd/init.so'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/lualib/kong/cmd/init.so'
no file './kong/cmd/init.so'
no file '/usr/local/lib/lua/5.1/kong/cmd/init.so'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/luajit/lib/lua/5.1/kong/cmd/init.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/Users/wuyachao/.luarocks/lib/lua/5.1/kong/cmd/init.so'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks/lib/lua/5.1/kong/cmd/init.so'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/site/lualib/kong.so'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/lualib/kong.so'
no file './kong.so'
no file '/usr/local/lib/lua/5.1/kong.so'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/openresty/luajit/lib/lua/5.1/kong.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/Users/wuyachao/.luarocks/lib/lua/5.1/kong.so'
no file '/opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks/lib/lua/5.1/kong.so'
stack traceback:
/opt/homebrew/bin/kong:9: in function 'file_gen'
init_worker_by_lua:46: in function <init_worker_by_lua:44>
[C]: in function 'xpcall'
init_worker_by_lua:53: in function <init_worker_by_lua:51>

@wuyachao
Copy link
Author

I have add the paths
echo $path
/Users/wuyachao/.luarocks/bin /opt/homebrew/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks/bin /opt/homebrew/opt/php@7.4/sbin /opt/homebrew/opt/php@7.4/bin /opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/go/bin

@wuyachao
Copy link
Author

#6677 eval luarocks path
it doesn't work to me

@wuyachao
Copy link
Author

ln -s /opt/homebrew/Cellar/kong/2.5.0/share/* /usr/local/share/

it has new error:

ERROR: ./pl/path.lua:26: pl.path requires LuaFileSystem
stack traceback:
	./pl/path.lua:26: in main chunk
	[C]: in function 'require'
	./kong/tools/utils.lua:16: in main chunk
	[C]: in function 'require'
	./kong/globalpatches.lua:237: in function <./kong/globalpatches.lua:4>
	./kong/cmd/init.lua:1: in main chunk
	[C]: in function 'require'
	/opt/homebrew/bin/kong:9: in function 'file_gen'
	init_worker_by_lua:46: in function <init_worker_by_lua:44>
	[C]: in function 'xpcall'
	init_worker_by_lua:53: in function <init_worker_by_lua:51>

@gszr
Copy link
Member

gszr commented Dec 7, 2021

Hi all,

I just opened Kong/homebrew-kong#185 that should fix this issue. Would you mind giving it a try?

You can do something like the following to test it:

cd `brew --repo`/Library/Taps/kong/homebrew-kong
git pull
git checkout fix/m1-path-cpath
brew install kong

@lienhui97
Copy link

Hi all,

I just opened Kong/homebrew-kong#185 that should fix this issue. Would you mind giving it a try?

You can do something like the following to test it:

cd `brew --repo`/Library/Taps/kong/homebrew-kong
git pull
git checkout fix/m1-path-cpath
brew install kong

I get the same error, it work for me ,thanks

@gszr
Copy link
Member

gszr commented Dec 8, 2021

it work for me ,thanks

Thanks for trying it out!

@gszr
Copy link
Member

gszr commented Dec 15, 2021

@lienhui97,

Were you able to start Kong in your MacOS m1 environment -- or only install it?

Cheers!

@lienhui97
Copy link

lienhui97 commented Dec 20, 2021 via email

@gszr
Copy link
Member

gszr commented Dec 20, 2021

Hi all,

What MacOS version do you have? We have uncovered a few issues with m1 on MacOS 12.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distribution task/needs-investigation Requires investigation and reproduction before classifying it as a bug or not.
Projects
None yet
4 participants