Problem Using LuaRocks

General discussion about LÖVE, Lua, game development, puns, and unicorns.
bonez001
Prole
Posts: 36
Joined: Wed Sep 14, 2016 8:14 am

Problem Using LuaRocks

Post by bonez001 »

Hello everyone. I am trying to use LuaRocks. I am using lua5.1. I just click the install.bat after downloading the win file. When I run luarocks in cmd, it says "The system cannot find specified path." I already added the path in the Enviroment Variables where you can find luarocks.bat. What do you think is wrong? I need your help.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Problem Using LuaRocks

Post by Positive07 »

Since debugging this kind of errors is hard, could you please post an screenshot?
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
bonez001
Prole
Posts: 36
Joined: Wed Sep 14, 2016 8:14 am

Re: Problem Using LuaRocks

Post by bonez001 »

love2d.png
love2d.png (7.64 KiB) Viewed 7453 times
DO you think it has something to do with the config.-5.1.lua? Note that it initially says config.-5.3.lua. I just change the name.
Attachments
1.png
1.png (21.23 KiB) Viewed 7453 times
bonez001
Prole
Posts: 36
Joined: Wed Sep 14, 2016 8:14 am

Re: Problem Using LuaRocks

Post by bonez001 »

This is what is inside config-5.1.lua

rocks_trees = {
{ name = [[user]],
root = home..[[C:\Program Files (x86)\LuaRocks]],
},
{ name = [[system]],
root = [[C:\gcc-lua-install\lua\lua-5.1]],
},
}
variables = {
MSVCRT = 'MSVCRT',
LUALIB = 'lua51.lib'
}
verbose = false -- set to 'true' to enable verbose output
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Problem Using LuaRocks

Post by Positive07 »

Yeah, you'll probably need to build LuaRocks again, it has been built against Lua 5.3 and you try to run it with a different version (5.1) so it may not run at all.

In another note, luarocks (C:\ProgramFiles x86\LuaRocks) and lua5.1 (C:\gcc-lua-install\lua\lua-5.1 I guess?) need to be in your PATH environment variable.

Also I have never configured luarocks myself but I think it expects to find a few environment variables like LUAINC, LUALIB and whatnot. It should have a tutorial to manually install somewhere though

PS: If you built with MinGW the dll generated for LuaJIT may not be compatible with MSVC built LuaJIT dll (such as the one in LÖVE), I may be wrong but I heard about this a couple of times so I always build with the Community Version of Visual Studio 2013 which is free. Also the dll should have the same name as LÖVE's (lua51.dll) so if you used a different name (lua-5.1.dll, lua-51.dll, lua5.1.dll) it won't find it when you use the dll with LÖVE... yeah this is not easy, so if you did all that then you may be good.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
bonez001
Prole
Posts: 36
Joined: Wed Sep 14, 2016 8:14 am

Re: Problem Using LuaRocks

Post by bonez001 »

Thanks. I just forgot to add all paths. It is working now but I have another error installing luasql:


LNK1181:cannot open input file 'mysqlclient.lib'
Attachments
Screenshot 2016-10-12 14.48.17.png
Screenshot 2016-10-12 14.48.17.png (20.07 KiB) Viewed 7424 times
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Problem Using LuaRocks

Post by Positive07 »

I suggest you move everything in the "C:\Program Files\MySQL\MySQL Connector\include" and "C:\Program Files\MySQL\MySQL Connector\lib" to a path with no spaces like "C:\MySQL\include" and "C:\MySQL\lib" because the problem may be that the quotes are discarded and your path contains spaces so the linker can't handle those paths... For more information on the issue check support from Microsoft
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
bonez001
Prole
Posts: 36
Joined: Wed Sep 14, 2016 8:14 am

Re: Problem Using LuaRocks

Post by bonez001 »

Hello thanks for the reply. I finally installed (I think) luasql-mysql but I have some trouble loading it. When I run in CMD the following codes:

local mysql = require("luasql-mysql")

the console says module not found. It seems the only thing that installation gave is mysql.dll. I cannot find any luasql.lua or luasql.mysql LUA file in my computer.

Below are the images


Hope someone can help me. It seems I am near completing it.
Attachments
Screenshot 2016-10-12 18.10.45.png
Screenshot 2016-10-12 18.10.45.png (15.19 KiB) Viewed 7399 times
Screenshot 2016-10-12 17.37.12.png
Screenshot 2016-10-12 17.37.12.png (22.4 KiB) Viewed 7399 times
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

Re: Problem Using LuaRocks

Post by Zireael »

'luasql-mysql' is the rock name. The dll names are not necessarily identical.

Try requiring require("mysql") instead to see if it finds the dll.

When I had similar problems, I moved the dlls to one of the folders listed in the error message and it worked.
bonez001
Prole
Posts: 36
Joined: Wed Sep 14, 2016 8:14 am

Re: Problem Using LuaRocks

Post by bonez001 »

Hello. Thanks for the reply. I try putting the dll file but I got the following error:
Attachments
Screenshot 2016-10-13 13.30.26.png
Screenshot 2016-10-13 13.30.26.png (12.85 KiB) Viewed 7305 times
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests