lua-users home
lua-l archive

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


I don't know about the customizations Gentoo developers perform to the
installation, but from the diagnostics it seems they are configuring
LuaRocks so it installs packages by default in an isolated directory
(probably to avoid conflicts with their own packages).

Try running this in your shell (note the backquotes). This should
enable their install directory as a Lua path, for that shell instance:

   eval `luarocks path`

To make this permanent, this command (or the output of "luarocks
path") should be added to your login script (~/.bash_profile, ~/.zshrc
or similar).

The default install of vanilla LuaRocks installs to /usr/local, which
is a path recognized by vanilla Lua, so this issue does not come up.

-- Hisham
http://hisham.hm/


On Tue, Jun 19, 2012 at 12:39 AM,  <meino.cramer@gmx.de> wrote:
> Hi,
>
> On my Gentoo Linux I installed lua and luarocks using emerge,
> the package manager of Gentoo.
>
> Then I used luarocks to install the lpeg package.
>
> When trying to use lpeg via lua, it cannot find the lpeg package:
>
> luarocks says:
>    solfire:/root>luarocks install lpeg
>    Installing http://luarocks.org/repositories/rocks/lpeg-0.10-2.src.rock...
>    Using http://luarocks.org/repositories/rocks/lpeg-0.10-2.src.rock... switching to 'build' mode
>    Archive:  /tmp/luarocks_luarocks-rock-lpeg-0.10-2-4603/lpeg-0.10-2.src.rock
>    inflating: lpeg-0.10-2.rockspec
>    inflating: lpeg-0.10.tar.gz
>    Do not use 'module' as a build type. Use 'builtin' instead.
>    gcc -O2 -fPIC -I/usr/include -c lpeg.c -o lpeg.o
>    gcc -shared -o lpeg.so -L/usr/lib64 lpeg.o
>    Updating manifest for /usr/lib64/lua/luarocks/lib/luarocks/rocks
>
>    lpeg 0.10-2 is now built and installed in /usr/lib64/lua/luarocks/ (license: MIT/X11)
>
>
> Lua says
>    /home/user/lua
>    Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>    require 'lpeg'
>    stdin:1: module 'lpeg' not found:
>        no field package.preload['lpeg']
>        no file './lpeg.lua'
>        no file '/usr/local/share/lua/5.1/lpeg.lua'
>        no file '/usr/local/share/lua/5.1/lpeg/init.lua'
>        no file '/usr/local/lib/lua/5.1/lpeg.lua'
>        no file '/usr/local/lib/lua/5.1/lpeg/init.lua'
>        no file '/usr/share/lua/5.1/lpeg.lua'
>        no file '/usr/share/lua/5.1/lpeg/init.lua'
>        no file './lpeg.so'
>        no file '/usr/local/lib/lua/5.1/lpeg.so'
>        no file '/usr/lib/lua/5.1/lpeg.so'
>        no file '/usr/local/lib/lua/5.1/loadall.so'
>    stack traceback:
>        [C]: in function 'require'
>        stdin:1: in main chunk
>        [C]: ?
>    >
>    >
>
> Or:
>    /home/user>lua -llpeg
>    lua: module 'lpeg' not found:
>        no field package.preload['lpeg']
>        no file './lpeg.lua'
>        no file '/usr/local/share/lua/5.1/lpeg.lua'
>        no file '/usr/local/share/lua/5.1/lpeg/init.lua'
>        no file '/usr/local/lib/lua/5.1/lpeg.lua'
>        no file '/usr/local/lib/lua/5.1/lpeg/init.lua'
>        no file '/usr/share/lua/5.1/lpeg.lua'
>        no file '/usr/share/lua/5.1/lpeg/init.lua'
>        no file './lpeg.so'
>        no file '/usr/local/lib/lua/5.1/lpeg.so'
>        no file '/usr/lib/lua/5.1/lpeg.so'
>        no file '/usr/local/lib/lua/5.1/loadall.so'
>    stack traceback:
>        [C]: ?
>        [C]: ?
>    [1]    22265 exit 1     lua -llpeg
>
>
> How can I explain luarocks to install the package at the correct place
> OR how can I explain lua to search at another place? Why is it needed
> at all?
>
> Best regards,
> mcc
>
>
>
>