luvit/luvit — Issue #135: "luaL_newstate has failed" on OS X 10.6
Author: gbluma
Created: 2012-02-22 23:13:49+00:00
State: open

Hello,

I already found a solution, but adding this here for posterity.

**The Problem:**
I built a new install of luvit on OS X 10.6 using the directions on http://luvit.io

$ git clone https://github.com/luvit/luvit.git
$ cd luvit
$ make
$ make install

These worked great, but the when I run the program I get a "luaL_newstate" error:

$ luvit

luaL_newstate has failed

**The Solution**:
Turns out the issue was related to my machine choosing its build architecture as x86_64 instead of i386. Telling GCC to use i386 prior to `make` seemed to do the trick for me (the two `export` lines below).

$ export CC="gcc-4.2 -arch i386"
$ export CXX="g++-4.2 -arch i386"
$ make
$ make install