LuaRocks
This is LuaRocks, a deployment and management system for Lua modules.
LuaRocks allows you to install Lua modules as self-contained packages called "rocks", which also contain version dependency information. This information is used both at install time, so that when one rock is requested all rocks it depends on are installed as well, and at run time, so that when a module is required, the correct version is loaded. LuaRocks supports both local and remote repositories, and multiple local rocks trees. You can download and install LuaRocks on Unix and Windows.
LuaRocks is free software and uses the same license as Lua 5.1.
有这个东西安装lua的模块就方便了
LuaRocks 0.5.2, a module deployment system for Lua
luarocks - LuaRocks main command-line interface
usage: luarocks [--from=<server> | --only-from=<server>] [--to=<tree>] [VAR=VALUE]... <command> [<argument>]
Variables from the "variables" table of the configuration file
can be overriden with VAR=VALUE assignments.
--from=<server> Fetch rocks/rockspecs from this server
(takes priority over config file)
--only-from=<server> Fetch rocks/rockspecs from this server only
(overrides any entries in the config file)
--to=<tree> Which tree to operate on.
Supported commands:
build Build/compile a rock.
help Help on commands.
install Install a rock.
list Lists currently installed rocks.
make Compile package in current directory using a rockspec.
pack Create a rock, packing sources or binaries.
remove Uninstall a rock.
search Query the LuaRocks servers.
unpack Unpack the contents of a rock.
比如:
我要安装copas 那么 luarocks install copas
但是 lua -l copas还是出错 原因是rocks安装的模块不是在标准的lua 路径下 可以这样解决
lua -l luarocks.require -l copas 搞定
luarocks.require会取代lua标准的require 这样就可以顺利引导模块。
Enjoy Lua!
This is LuaRocks, a deployment and management system for Lua modules.
LuaRocks allows you to install Lua modules as self-contained packages called "rocks", which also contain version dependency information. This information is used both at install time, so that when one rock is requested all rocks it depends on are installed as well, and at run time, so that when a module is required, the correct version is loaded. LuaRocks supports both local and remote repositories, and multiple local rocks trees. You can download and install LuaRocks on Unix and Windows.
LuaRocks is free software and uses the same license as Lua 5.1.
有这个东西安装lua的模块就方便了
LuaRocks 0.5.2, a module deployment system for Lua
luarocks - LuaRocks main command-line interface
usage: luarocks [--from=<server> | --only-from=<server>] [--to=<tree>] [VAR=VALUE]... <command> [<argument>]
Variables from the "variables" table of the configuration file
can be overriden with VAR=VALUE assignments.
--from=<server> Fetch rocks/rockspecs from this server
(takes priority over config file)
--only-from=<server> Fetch rocks/rockspecs from this server only
(overrides any entries in the config file)
--to=<tree> Which tree to operate on.
Supported commands:
build Build/compile a rock.
help Help on commands.
install Install a rock.
list Lists currently installed rocks.
make Compile package in current directory using a rockspec.
pack Create a rock, packing sources or binaries.
remove Uninstall a rock.
search Query the LuaRocks servers.
unpack Unpack the contents of a rock.
比如:
我要安装copas 那么 luarocks install copas
但是 lua -l copas还是出错 原因是rocks安装的模块不是在标准的lua 路径下 可以这样解决
lua -l luarocks.require -l copas 搞定
luarocks.require会取代lua标准的require 这样就可以顺利引导模块。
Enjoy Lua!