[SOLVED] require can't read files from LUA_PATH when installed via snap
Posted: Wed May 15, 2019 7:33 pm
Hi everyone,
I hope, this question wasn't answered before - I couldn't find relevant information in the forums or the wiki.
I'm new to Löve (using version 11.1) and are trying to load a library ("bump"), which I installed with luarocks (on Ubuntu 18.04). The luarocks path was added to ~/.profile, so every application runs with the specific path. I understand, that it is recommended to copy all required libraries into the game path (especially for distributing), but Löve gives me an error message, which is simply wrong:
main.lua:
Error:
Do note, that require searches in "/usr/local/share/lua/5.2". The thing is, the file is right there:
Why doesn't require find it?
I hope, this question wasn't answered before - I couldn't find relevant information in the forums or the wiki.
I'm new to Löve (using version 11.1) and are trying to load a library ("bump"), which I installed with luarocks (on Ubuntu 18.04). The luarocks path was added to ~/.profile, so every application runs with the specific path. I understand, that it is recommended to copy all required libraries into the game path (especially for distributing), but Löve gives me an error message, which is simply wrong:
main.lua:
Code: Select all
local bump = require "bump"
Code: Select all
Error: main.lua:1: module 'bump' not found:
no field package.preload['bump']
no 'bump' in LOVE game directories.
no file 'bump' in LOVE paths.
no file '/home/<username>/.luarocks/share/lua/5.2/bump.lua'
no file '/home/<username>/.luarocks/share/lua/5.2/bump/init.lua'
no file '/usr/local/share/lua/5.2/bump.lua'
no file '/usr/local/share/lua/5.2/bump/init.lua'
no file '/usr/local/lib/lua/5.2/bump.lua'
no file '/usr/local/lib/lua/5.2/bump/init.lua'
no file '/usr/share/lua/5.2/bump.lua'
no file '/usr/share/lua/5.2/bump/init.lua'
no file './bump.lua'
no file '/home/<username>/.luarocks/lib/lua/5.2/bump.so'
no file '/usr/local/lib/lua/5.2/bump.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/bump.so'
no file '/usr/lib/lua/5.2/bump.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './bump.so'
stack traceback:
[string "boot.lua"]:637: in function <[string "boot.lua"]:633>
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[string "boot.lua"]:475: in function <[string "boot.lua"]:311>
[C]: in function 'xpcall'
[string "boot.lua"]:645: in function <[string "boot.lua"]:639>
[C]: in function 'xpcall'
Code: Select all
<username>@<hostname>:~$ file /usr/local/share/lua/5.2/bump.lua
/usr/local/share/lua/5.2/bump.lua: UTF-8 Unicode text