That is a very nice script. Thanks a lot for sharing this Jim. I had
never used a sandboxed environment before, but this is really nice! I
got it all working now.

After installing the sandbox I initially got the same error I got when
I installed wsapi as the root user, a exec error in the Apache log:

[Wed Jul 14 21:13:35 2010] [error] [client ::1] (8)Exec format error:
exec of '/Users/thijskoerselman/Sites/luatesting/hello.lua' failed
[Wed Jul 14 21:13:35 2010] [error] [client ::1] Premature end of
script headers: hello.lua

It turned out that with all the edits I made I introduced an error in
hello.lua. The first line containing #! was not the first line
anymore. I couldn't even execute hello.lua directly from the
commandline anymore.

When I fixed that it all worked. My conclusion is the only thing that
kept wsapi from working on my system was that my rocks were installed
on a user level rather than system wide and wsapi needs to be
installed system wide in order for Apache to find things.

I must say I have found it VERY easy to mess up a luarocks
installation. Mainly because you can use sudo or not when you install
a new rock, and luarocks won't warn you. Also you can get warnings
about missing manifest files, tricking you into thinking you need to
generate a manifest file with luarocks-admin and then messing things
up because you add or forget to execute the command as a root user. It
has bitten me a few times now. Maybe I should have studied the
luarocks manual a bit better to start with, but its certainly not
foolproof.

Anyway, I'm glad I finally got a proper working system with wsapi. I
will continue to work with the sandbox since I really like the
concept.

Thanks for all the help.

Cheers, Thijs


On Wed, Jul 14, 2010 at 5:10 PM, Jim Whitehead II <jnwhi...@gmail.com> wrote:
> On Wed, Jul 14, 2010 at 3:59 PM, Thijs Koerselman
> <thijskoersel...@gmail.com> wrote:
>> Hmm this isn't looking very good at all. I installed luarocks + the
>> wsapi module as a root user, and now my other luarocks installation is
>> messed up:
>>
>> thijskoerselman$ luarocks list
>> Failed loading manifest for 
>> /Users/thijskoerselman/.luarocks/lib/luarocks/rocks
>>
>> Installed rocks:
>> ----------------
>>
>> luafilesystem
>>   1.5.0-1 (installed) - /opt/local/var/luarocks/lib/luarocks/rocks
>>
>> wsapi
>>   1.3.4-1 (installed) - /opt/local/var/luarocks/lib/luarocks/rocks
>>
>>
>> All the rocks I had installed are not listed, only the root ones. What
>> would be the correct way to clean this mess, I'm starting to get
>> confused.
>
> I would remove luarocks from both installed locations, and clear both
> of your rocks trees. When I am writing applications, particularly for
> the web I ALWAYS install a new copy of both lua and luarocks, to keep
> them separate from everything else in my system. It also helps
> immensely with troubleshooting.
>
> Create a directory that you want to include your application and
> environment. Create a file install.sh and add the following script to
> that file:
>
> http://snipt.net/jnwhiteh/install-lua-and-luarocks-into-a-sandboxed-directory/
>
> Run this shell script, which will take care of downloading lua and
> luarocks and installing them into your current directory. Once that's
> all done, you'll have a sandboxed lua/luarocks installation.
>
> To add a rock, use ./sandbox/bin/luarocks install wsapi
>
> Now to use this Lua/Luarocks, just point your hello.lua to it
> directly. If you post that, I can help you with it as well.
>
> - Jim
>
> _______________________________________________
> Kepler-Project mailing list
> Kepler-Project@lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
> http://www.keplerproject.org/
>

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to