lua-users home
lua-l archive

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


On 20 May 2014 01:27, luciano de souza <luchyanus@gmail.com> wrote:
> Hisham,
>
> After doing "sudo luarocks install luaxml' or "sudo luarocks install
> LuaXML', I received the message of successful instalation. The "show"
> command is also sucessful:
>
> $ luarocks show LuaXML
>
>
> LuaXML 101012-1 - a module that maps between Lua and XML without much ado
>
> LuaXML provides a minimal set of functions for the processing of XML data in
> Lua. It offers a very simple and natural mapping between the XML data format
> and Lua tables, which allows one to parse XML data just using Lua's normal
> table access and iteration methods: Substatements and text content is
> represented as array data having numerical keys, attributes and tags use string
> keys. This representation makes sure that the structure of XML data is exactly
> preserved in a read/write cycle.
>
> License:        MIT/X11
> Homepage:       http://viremo.eludi.net/LuaXML/
> Installed in:   /usr/local
>
> Modules:
>         LuaXML_lib
>         LuaXml

Strange that the full path of the modules does not show up there. Your
LuaRocks is probably outdated. `luarocks --version`?

> On the commandline, there's no difference between 'luaxml' or
> 'LuaXML'.

Yes, _rock names_ are case-insensitive in the `luarocks` command-line
tool (because .rock files must always be lowercase). But note that Lua
modules are case-sensitive.

> On the interpreter, the two writtings produce the same
> result: 'module not found'.
>
> I tried also:
>
> package.cpath == package.cpath .. ';/usr/local/lib/lua/5.1'

Just in case you made a typo: there's an extra = there.

> require('LuaXML')
>
> It's really unblievable. I only have finished the reinstalation of
> Ubuntu, so I don't have problems in my system, I have a successful
> message of instalation on Luarocks, but even indicating the path with
> package.cpath, the module is not found.
>
> It's a mistery!

A more recent version of LuaRocks would have showed where the modules
were installed with `luarocks show luaxml`. Well, you should have
files LuaXML.lua and LuaXML_lib.so somewhere in your system. Looks
like the default configuration in Ubuntu is doing something strange.
Adjust your package paths accordingly and it should work.

Also, this may work too:

$ eval $(luarocks path)

(It will auto-adjust package paths, but only for the current shell instance.)

-- Hisham

> 2014-05-20 1:10 GMT-03:00, luciano de souza <luchyanus@gmail.com>:
>> Unfortunatelly, the result was the same: "Module 'luaxml' is not found".
>>
>> Supposing that "pcall(require, 'luarocks')" is the protected version
>> of "require('luarocks')", I try also: require('luarocks'). However,
>> the module 'luarocks' is also not found.
>>
>> 2014-05-20 1:02 GMT-03:00, Coroutines <coroutines@gmail.com>:
>>> On Mon, May 19, 2014 at 9:00 PM, luciano de souza <luchyanus@gmail.com>
>>> wrote:
>>>
>>>> $ sudo apt-get install lua5.1
>>>> $ sudo apt-get install luarocks
>>>> $ sudo luarocks install luaxml
>>>> $ lua
>>>>> require('luaxml')
>>>> "Module 'luaxml' is not found'".
>>>>
>>>> Does someone knows why it occurs and how to solve it?
>>>
>>> pcall(require, 'luarocks') -- i think.
>>> require('luaxml')
>>>
>>>
>>
>>
>> --
>> Luciano de Souza
>>
>
>
> --
> Luciano de Souza
>