apisix icon indicating copy to clipboard operation
apisix copied to clipboard

request help: 没有安装cjson,但仍要求删除cjson

Open HuangDayu opened this issue 6 years ago • 8 comments

Issue description

huangdayu@SK-20191227AUWA:~/apache-apisix-1.5$ make deps
luarocks install rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
Stopping after installing dependencies for apisix master-0

huangdayu@SK-20191227AUWA:~/apache-apisix-1.5$ ./bin/apisix version
please remove the cjson library in Lua, it may conflict with the cjson library in openresty.
 luarocks remove cjson
huangdayu@SK-20191227AUWA:~/apache-apisix-1.5$ sudo luarocks remove cjson

Error: Could not find rock 'cjson' in /usr/local
huangdayu@SK-20191227AUWA:~/apache-apisix-1.5$

Environment

  • apisix version (cmd: apisix version): 1.5
  • OS:
LSB Version:    core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

HuangDayu avatar Oct 14 '20 09:10 HuangDayu

Try lua -e "require 'cjson'"?

spacewander avatar Oct 14 '20 09:10 spacewander

And lua -e "require('table.new')". Please show us your output.

spacewander avatar Oct 14 '20 09:10 spacewander

huangdayu@SK-20191227AUWA:~/apache-apisix-1.5$ lua -e "require 'cjson'"
huangdayu@SK-20191227AUWA:~/apache-apisix-1.5$ lua -e "require('table.new')"
lua: (command line):1: module 'table.new' not found:
        no field package.preload['table.new']
        no file './table/new.lua'
        no file '/usr/local/share/lua/5.1/table/new.lua'
        no file '/usr/local/share/lua/5.1/table/new/init.lua'
        no file '/usr/local/lib/lua/5.1/table/new.lua'
        no file '/usr/local/lib/lua/5.1/table/new/init.lua'
        no file '/usr/share/lua/5.1/table/new.lua'
        no file '/usr/share/lua/5.1/table/new/init.lua'
        no file './table/new.so'
        no file '/usr/local/lib/lua/5.1/table/new.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/table/new.so'
        no file '/usr/lib/lua/5.1/table/new.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './table.so'
        no file '/usr/local/lib/lua/5.1/table.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/table.so'
        no file '/usr/lib/lua/5.1/table.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        (command line):1: in main chunk
        [C]: ?

@spacewander

HuangDayu avatar Oct 14 '20 11:10 HuangDayu

Look like you has cjson installed on your machine but it is not installed via luarocks. Maybe you can find cjson.so under your package.cpath.

spacewander avatar Oct 14 '20 12:10 spacewander

@spacewander 感谢,虽然我还没解决,但是我换CentOS了,CentOS就没问题。

HuangDayu avatar Oct 15 '20 09:10 HuangDayu

Look like you has cjson installed on your machine but it is not installed via luarocks. Maybe you can find cjson.so under your package.cpath.

issues/2431 可以解答一下这个问题吗?非常感谢。

HuangDayu avatar Oct 15 '20 09:10 HuangDayu

lhuangdayu@SK-20191227AUWA:~/apache-apisix-1.5$ lua -e "require 'cjson'"

@HuangDayu

it seems that you installed cjson library for standard Lua land.

membphis avatar Oct 15 '20 15:10 membphis

If there is no more information to provide, I think this issue can be closed. Do you agree? @HuangDayu @membphis

idbeta avatar Nov 05 '20 09:11 idbeta