Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua:5: module 'lfs' not found even after running luarocks .. #142

Open
nodecentral opened this issue Nov 10, 2020 · 4 comments
Open

lua:5: module 'lfs' not found even after running luarocks .. #142

nodecentral opened this issue Nov 10, 2020 · 4 comments

Comments

@nodecentral
Copy link

nodecentral commented Nov 10, 2020

Hi

I’m trying to get the LfS installed, and have tried luarocks a few times, but when I eventually run some code that requires it , it’s not found ? Any ideas ?

pi@raspberrypi:~ $ sudo luarocks install luafilesystem
Warning: falling back to wget - install luasec to get native HTTPS support
Installing https://rocks.moonscript.org/luafilesystem-1.8.0-1.src.rock...
Using https://rocks.moonscript.org/luafilesystem-1.8.0-1.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/lfs.c -o src/lfs.o
gcc -shared -o lfs.so -L/usr/local/lib src/lfs.o
Updating manifest for /usr/local/lib/luarocks/rocks
luafilesystem 1.8.0-1 is now built and installed in /usr/local (license: MIT/X11)

When I try to use the lfs module I always get the following message ??

usr/bin/lua: ./ircodetest10.lua:5: module 'lfs' not found:
        no field package.preload['lfs']
        no file '/usr/local/share/lua/5.2/lfs.lua'
        no file '/usr/local/share/lua/5.2/lfs/init.lua'
        no file '/usr/local/lib/lua/5.2/lfs.lua'
        no file '/usr/local/lib/lua/5.2/lfs/init.lua'
        no file '/usr/share/lua/5.2/lfs.lua'
        no file '/usr/share/lua/5.2/lfs/init.lua'
        no file './lfs.lua'
        no file '/usr/local/lib/lua/5.2/lfs.so'
        no file '/usr/lib/arm-linux-gnueabihf/lua/5.2/lfs.so'
        no file '/usr/lib/lua/5.2/lfs.so'
        no file '/usr/local/lib/lua/5.2/loadall.so'
        no file './lfs.so'
stack traceback:
        [C]: in function 'require'
        ./ircodetest10.lua:5: in main chunk
        [C]: in ?

@nodecentral nodecentral changed the title module 'lfs' not found even after running luarocks .. lua:5: module 'lfs' not found even after running luarocks .. Nov 10, 2020
@nodecentral
Copy link
Author

nodecentral commented Nov 10, 2020

Checking /use/local/ which luarocks reported, I can’t see it listed?

pi@raspberrypi:/usr/local $ ls
bin  etc  games  include  lib  man  sbin  share  src

@Kabouik
Copy link

Kabouik commented Jan 20, 2021

I am having the same issue. Note that my distribution does not offer any luafilesystem package, so I just used sudo luarocks install luafilesystem, it is not clear to me if that is enough or if the module would be found only if a distributioin package is installed as well (in which case, I'm stuck, unless I compile it).

$ echo $LUA_PATH
/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib/lua/5.3/?.lua;/usr/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua;/home/mathieu/.luarocks/share/lua/5.3/?.lua;/home/mathieu/.luarocks/share/lua/5.3/?/init.lua

@robertlzj
Copy link

I'm using windows only, some suggestion try to help.

  1. Check the actual file location of lfs.so, seems at '/usr/local'?
  2. move file to path where lua could find it - from package.cpath (like usr/lib/lua/5.2/), or append file path to cpath.

@Kabouik
Copy link

Kabouik commented Feb 7, 2021

I don't know about @nodecentral, but in my case just running sudo luarocks install luafilesystem on Debian was enough this time.

My initial goal was to compile the luakit web browser. I pulled the luakit sources from git again today and had to install luajit and libluajit-5.1-dev with apt, then the compilation of luakit just worked.

This was already what I tried three weeks ago when I got the error, so I'm not sure what changed; maybe the luakit sources coincidentally fixed that.

[Edit] Wait, I just realized I was having this issue on another machine with another distribution. The issue is probably still there on that machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants