1
Lua中找不到安裝luarocks我安裝luarocks:在Ubuntu
$ sudo apt-get install luarocks
我安裝LUA-cjson由luarocks:
$sudo luarocks install lua-cjson
節目包:
$luarocks list
Installed rocks:
----------------
lua-cjson
2.1.0-1 (installed) - /usr/local/lib/luarocks/rocks
所以,我看包:
$luarocks show lua-cjson
License: MIT
Homepage: http://www.kyne.com.au/~mark/software/lua-cjson.php
Installed in: /usr/local
. . .
Modules:
cjson
lua2json
json2lua
cjson.util
lua-cjson
2.1.0-1 (installed) - /usr/local/lib/luarocks/rocks
但是,Lua中無法看到的模塊:
$lua
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> require "cjson"
stdin:1: module 'cjson' not found:
....
$locate cjson.so
/usr/local/lib/lua/5.1/cjson.so
它是什麼錯誤?