Luarocks fails installing 'async' & 'trepl' [Error: Connection timed out] - lua

Hello fellow programmers,
I'm new to the Lua world. I'm working with this application and I constantly end up receiving the following error while trying to run the code following their README:
/usr/bin/luajit: /usr/share/lua/5.1/trepl/init.lua:383: module 'display' not found:No LuaRocks module found for display
no field package.preload['display']
no file '/tmp/buildd/.luarocks/share/lua/5.1/display.lua'
no file '/tmp/buildd/.luarocks/share/lua/5.1/display/init.lua'
no file '/usr/share/lua/5.1/display.lua'
no file '/usr/share/lua/5.1/display/init.lua'
no file './display.lua'
no file '/usr/share/luajit-2.1.0-beta1/display.lua'
no file '/usr/local/share/lua/5.1/display.lua'
no file '/usr/local/share/lua/5.1/display/init.lua'
no file '/gpfs01/bethge/home/hmoriceau/.luarocks/share/lua/5.1/display.lua'
no file '/gpfs01/bethge/home/hmoriceau/.luarocks/share/lua/5.1/display/init.lua'
no file '/tmp/buildd/.luarocks/lib/lua/5.1/display.so'
no file '/usr/lib/lua/5.1/display.so'
no file './display.so'
no file '/usr/local/lib/lua/5.1/display.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/gpfs01/bethge/home/hmoriceau/.luarocks/lib/lua/5.1/display.so'
stack traceback:
[C]: in function 'error'
/usr/share/lua/5.1/trepl/init.lua:383: in function 'require'
stylization_train.lua:9: in main chunk
[C]: in function 'dofile'
/usr/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670
Naturally I tried to run a sudo luarocks install display but get the following error:
Installing https://raw.githubusercontent.com/torch/rocks/master/display-scm-0.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/display-scm-0.rockspec... switching to 'build' mode
Missing dependencies for display:
async >= 1.0
luasocket >= 2.0
Using https://raw.githubusercontent.com/torch/rocks/master/async-scm-1.rockspec... switching to 'build' mode
Cloning into 'async'...
fatal: unable to connect to github.com:
github.com[0: 192.30.253.113]: errno=Connection timed out
Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/async-scm-1.rockspec - Failed cloning git repository.
Some people have had similar errors but I think the source of this one is different. I also think that it is unlikely that the mirror for this module is down.
Lua version: 5.2.3
Installed using sudo apt-get install lua5.2 after having updated&&upgraded everything.
Your help is appreciated!
Best,
Hichame

For anyone else who had this issue, I managed to solve it using: git config --global url.https://github.com/.insteadOf git://github.com/
For documentation, you might also be interested in knowing that you can manually install lua modules using:
git clone <module-repo>
cd <module-repo-directory>
sudo luarocks make

Related

Issues with running remix Binary in Bazel sandbox

I've encountered an issue trying to use bazel as a build tool for remix. I've been able to run remix in dev mode but currently unable to get remix build to work.
I've encountered a few errors that led up to this point. I'll list the errors in the order which they occurred with my fixes (just incase any of the fixes introduces a new issue)
First error in the bazel sandbox is related to a transitive dependency of #remix-run/dev (#remix-run/dev->gunzip-maybe->browserify-zlib). Bazel failed to fetch the bazel repository #npm__browserify-zlib__0.1.4. I assumed this was a bazel issue and tried to override browserify-zlib#0.1.4 with browserify-zlib#0.2.0, which worked. Here is bazel error for reference:
ERROR: /Users/emmanuel/projects/bbbazel/WORKSPACE:89:17: fetching _npm_import rule //external:npm__browserify-zlib__0.1.4: Traceback (most recent call last):
File "/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/aspect_rules_js/npm/private/npm_import.bzl", line 471, column 27, in _impl
pkg_json = json.decode(rctx.read(pkg_json_path))
Error in decode: at offset 685, object has duplicate key: "main"
ERROR: /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/npm/BUILD.bazel:3012:6: #npm//:npm__browserify-zlib__0.1.4_source_directory depends on #npm__browserify-zlib__0.1.4//:source_directory in repository #npm__browserify-zlib__0.1.4 which failed to fetch. no such package '#npm__browserify-zlib__0.1.4//': at offset 685, object has duplicate key: "main"
Next error in the bazel sandbox is related to another transitive dependency of #remix-run/dev (#remix-run/dev->xdm->deasync). The install lifecycle hook for the deasync npm package makes a call to the node-gyp binary which doesn't exist in the sandbox and the bazel build command fails during setup. To fix this, I disabled the install lifecycle hook (I also disabled it with a pnpm install outside the sandbox and the remix build command executed perfectly) which led to the final error. Here's the error message for this error:
/Users/emmanuel/projects/bbbazel/BUILD.bazel:5:22: Running lifecycle hooks on npm package deasync#0.1.28 failed: (Exit 1): lifecycle-hooks.sh failed: error executing command (from target //:.aspect_rules_js/node_modules/deasync#0.1.28/lc) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/aspect_rules_js/npm/private/lifecycle/lifecycle-hooks.sh deasync ../../../external/npm__deasync__0.1.28/package ... (remaining 1 argument skipped)
/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/node-gyp-bin/node-gyp: line 5: 1211: command not found
node-gyp not found! Please upgrade your install of npm! You need at least 1.1.5 (I think) and preferably 1.1.30.
> deasync#0.1.28 install /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/deasync#0.1.28/node_modules/deasync
> node ./build.js
===============================================================
Failure while running lifecycle hook for package 'deasync#0.1.28':
Script: 'install'
Command: `node ./build.js`
Stack trace:
spawn ENOENT
at ChildProcess.<anonymous> (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/index.min.js:1:91930)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
The final error suggests a bug with remix, but since it only occurs in the bazel sandbox I think it may be an issue that cuts across bazel and remix. The error returned is shown below:
The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new
Missing output for entry point
Error
at Object.onCompileFailure (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:180:13)
at Object.compile (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/remixCompiler.js:34:134)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/build.js:33:3)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:175:3)
at async Object.run (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/run.js:449:7)
Building Remix app in production mode...
Target //examples/remix:build failed to build
I've tried to run it outside bazel and with pnpm (I added the override to the package.json for browserify-zlip#0.2.0, then I ran pnpm instal with --ignore-scripts flag) and it builds fine.
I'm not sure if this is a bug with remix or a bazel issue. Has anyone else experienced this? Or does anyone having a working version of remix with bazel as the build tool?
I've created a minified version of the repository in the state of the 3rd error https://github.com/noelenwenede/bbbazel. Start up instructions are in the readme file.

No LuaRocks module found for 'bit'

I am trying to run a code using torch7 and LUA and I get this error.
usr/local/torch/install/share/lua/5.2/trepl/init.lua:389: module 'bit' not found: No LuaRocks module found for 'bit'
no field package.preload['bit']
no file '/root/.luarocks/share/lua/5.2/bit.lua'
no file '/root/.luarocks/share/lua/5.2/bit/init.lua'
no file '/usr/local/torch/install/share/lua/5.2/bit.lua'
no file '/usr/local/torch/install/share/lua/5.2/bit/init.lua'
no file '/usr/local/torch/install/lib/lua/5.2/bit.lua'
no file '/usr/local/torch/install/lib/lua/5.2/bit/init.lua'
no file './bit.lua'
no file '/home/shaurovd/.luarocks/share/lua/5.2/bit.lua'
no file '/home/shaurovd/.luarocks/share/lua/5.2/bit/init.lua'
no file '/root/.luarocks/lib/lua/5.2/bit.so'
no file '/usr/local/torch/install/lib/lua/5.2/bit.so'
no file '/usr/local/torch/install/lib/lua/5.2/loadall.so'
no file './bit.so'
no file '/home/shaurovd/.luarocks/lib/lua/5.2/bit.so'
stack traceback:
[C]: in function 'error'
/usr/local/torch/install/share/lua/5.2/trepl/init.lua:389: in function 'require'
train.lua:16: in main chunk
[C]: in function 'dofile'
...ocal/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: in ?
Segmentation fault (core dumped)
I tried to install 'bit' locally in my profile as I don't have the write permission on the server (Ubuntu 18.04) I am working on using:
luarocks install --deps bit --local
But it shows: Error: No results matching query were found.
How do I solve this?
i solved it by running this command
luarocks install luaossl OPENSSL_DIR=/usr/local/kong CRYPTO_DIR=/usr/local/kong
check this post here github kong issue

How to fix error with CMake while installing LuaDist on Windows 10

I've been trying to install Luadist, but an error with CMake always happens and in the end it doesn't install because of it.
This seems to be a common issue on Windows 10. I've followed the instructions from https://github.com/LuaDist/Repository/wiki/LuaDist%3A-Installation and https://github.com/LuaDist/Repository/wiki/Installation-of-System-Dependencies#microsoft-windows . I've tried uninstalling it and installing it again, but it didn't work. I tried installing Lua on the same drive as LuaDist, but it still doesn't work. I think the error might be because I also have LuaRocks installed, I don't know if they are compatible together.
[ 37%] Performing configure step for 'luafilesystem'
loading initial cache file C:/Users/User/_bootstrap/_bootstrap/tmp/config.cmake
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.15/Modules/CMakeMinGWFindMake.cmake:12 (message):
sh.exe was found in your PATH, here:
C:/Program Files/Git/usr/bin/sh.exe
For MinGW make to work correctly sh.exe must NOT be in your path.
Run cmake from a shell that does not have sh.exe in your PATH.
If you want to use a UNIX shell, then use MSYS Makefiles.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
CMakeFiles\luafilesystem.dir\build.make:106: recipe for target 'luafilesystem/src/luafilesystem-stamp/luafilesystem-configure' failed
mingw32-make.exe[3]: *** [luafilesystem/src/luafilesystem-stamp/luafilesystem-configure] Error 1
CMakeFiles\Makefile2:114: recipe for target 'CMakeFiles/luafilesystem.dir/all' failed
mingw32-make.exe[2]: *** [CMakeFiles/luafilesystem.dir/all] Error 2
CMakeFiles\Makefile2:175: recipe for target 'CMakeFiles/install.dir/rule' failed
mingw32-make.exe[1]: *** [CMakeFiles/install.dir/rule] Error 2
Makefile:156: recipe for target 'install' failed
mingw32-make.exe: *** [install] Error 2
## Bootstrap done, building LuaDist using LuaDist
'C:\Users\User\_bootstrap\_bootstrap\bin\luadist.exe' is not recognized as an internal or external command,
operable program or batch file.
## LuaDist is now built and can be found in C:\Users\User\_bootstrap\_install
At the end it says that LuaDist is built in C:\Users\User_bootstrap_intall , but that folder doens't exist after the installation.

LuaJit won't find a library "lua-vips" installed via "luarocks"

I have this lua file:
-- test1.lua
--require "luarocks.loader"
vips = require "vips"
--vips = require "lua-vips"
local img = vips.Image.new_from_file("img1.jpg")
-- [...................]
It won't find the library "lua-vips" installed via "luarocks":
$ luajit test1.lua
luajit: error loading module 'vips' from file '/usr/local/lib/luarocks/rocks-5.3/':
cannot read /usr/local/lib/luarocks/rocks-5.3/: Is a directory
stack traceback:
[C]: at 0x0102caa660
[C]: in function 'require'
test1.lua:2: in main chunk
[C]: at 0x0102c3b8a0
Even after I add
export LUA_PATH="/usr/local/lib/luarocks/rocks-5.3/"
to ~/.profile, it won't.
The content of the directory luarocks -- lua-vips exists:
ls /usr/local/lib/luarocks/rocks-5.3/
lua-vips manifest
How how to fix this?
$ luarocks path
export LUA_PATH='/Users/my_user/.luarocks/share/lua/5.3/?.lua;/Users/my_user/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/Cellar/luarocks/3.0.1/share/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua'
export LUA_CPATH='/Users/my_user/.luarocks/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so'
export PATH='/Users/my_user/.luarocks/bin:/usr/local/bin:/Users/my_user/.yarn/bin:/Users/my_user/.config/yarn/global/node_modules/.bin:/Users/my_user/.nix-profile/bin:/Users/my_user/.nvm/versions/node/v8.14.0/bin:/Users/my_user/.cargo/bin:/Users/my_user/.gem/ruby/2.5.1/bin:/Users/my_user/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/bin:/Users/my_user/.rubies/ruby-2.5.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/my_user/go/bin'
Your problem is that LUA_PATH doesn't work the same way PATHs usually work.
You don't give it a directory, but a template string with an ? representing the name of the library to load.
So, for example, if you want to find files in the /path/to/libs/ directory, you'd write "/path/to/libs/?.lua;/path/to/libs/?/init.lua" for the path.
If you literally add "/usr/local/lib/luarocks/rocks-5.3/", Lua will try to load that directory as a Lua file, which causes your error.
Remove that environment variable and tell us what error you get.
Also keep in mind that adding something to .profile requires logging out and back in again for the changes to take effect (or to source ~/.profile in every new shell you open)

Error - "No LuaRocks module found for fb.python"

I am trying to implement a library which is a Github project on 3D reconstruction using a single image in Ubuntu 16.04. I have installed all dependencies. I have checked if each dependency is correctly installed with help from Google searches and stackoverflow.
But, when I am executing the ./run.sh as mentioned in the Github page, I get the following error.
/home/username/torch/install/bin/luajit: /home/username/torch/install/share/lua/5.1/trepl/init.lua:389: /home/username/torch/install/share/lua/5.1/trepl/init.lua:389: module 'fb.python' not found:No LuaRocks module found for fb.python
no field package.preload['fb.python']
no file '/home/username/.luarocks/share/lua/5.1/fb/python.lua'
no file '/home/username/.luarocks/share/lua/5.1/fb/python/init.lua'
no file '/home/username/torch/install/share/lua/5.1/fb/python.lua'
no file '/home/username/torch/install/share/lua/5.1/fb/python/init.lua'
no file './fb/python.lua'
no file '/home/username/torch/install/share/luajit-2.1.0-beta1/fb/python.lua'
no file '/usr/local/share/lua/5.1/fb/python.lua'
no file '/usr/local/share/lua/5.1/fb/python/init.lua'
no file '/home/username/.luarocks/lib/lua/5.1/fb/python.so'
no file '/home/username/torch/install/lib/lua/5.1/fb/python.so'
no file '/home/username/torch/install/lib/fb/python.so'
no file './fb/python.so'
no file '/usr/local/lib/lua/5.1/fb/python.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/home/username/.luarocks/lib/lua/5.1/fb.so'
no file '/home/username/torch/install/lib/lua/5.1/fb.so'
no file '/home/username/torch/install/lib/fb.so'
no file './fb.so'
no file '/usr/local/lib/lua/5.1/fb.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
/home/username/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
main.lua:8: in main chunk
[C]: in function 'dofile'
...name/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
ls: cannot access '*.txt': No such file or directory
This issue is in Torch directory and not in the project.
So please guide me how I can resolve it or what could have gone wrong.
P.S. I am new to Linux.
You need to install Torch first. th and luarocks both commands will be available after you install Torch, see Torch

Resources