lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Jun 30, 2010 at 07:29:23AM -0400, Patrick wrote:
> Okay now I getting worried this is just my stupidity. I tried
> require("curl") and ("cURL") but the module was not found. I did
> read the documentation that you sent but I am still stuck.

First of all, be sure you are using the lua interpreter coming from the 
package lua5.1:

  $ dpkg -L lua5.1
  ...
  /usr/bin/lua5.1
  ...
  $ update-alternatives --display lua-interpreter 
  lua-interpreter - auto mode
    link currently points to /usr/bin/lua5.1

If it is the case you should get that:

  $ lua -e 'print(package.path)'
  ./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua

  $ lua -e 'print(package.cpath)'
  ./?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so

Then check you have no LUA_INIT variable set (or that you have it set in
a consisten way):

 echo $LUA_INIT

Then, give a look at the content of the curl package:

 $ dpkg -L liblua5.1-curl0
 ...
 /usr/lib/liblua5.1-curl.so.0.0.0
 ...
 /usr/lib/lua/5.1/curl.so

The latter is a symlink pointing to the former file, and is what require
will look for whn you type require'curl'. Also note that the current
directory and /user/local are searched first that /usr/, so you may try 
load by mistake some .so you manually compiled.

Cheers.
-- 
Enrico Tassi