Was thinking over the weekend it would be cool to be able to parse some JS in Ruby. Discovered Johnson (and RKelly and a few other things). I'm currently using an old (2006) Mac Mini and Snow Leopard:
Model Name: Mac mini Model Identifier: Macmini1,1 Processor Name: Intel Core Duo Processor Speed: 1.66 GHz Number Of Processors: 1 Total Number Of Cores: 2 L2 Cache: 2 MB Memory: 2 GB Bus Speed: 667 MHz
I've been reading your back numbers (what fun) and I guess the lack of full 64-bit may be a snag. But here goes
~ $ ruby -v ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-darwin8.11.1] ~ $ file -L `which ruby` /usr/local/bin/ruby: Mach-O universal binary with 2 architectures /usr/local/bin/ruby (for architecture i386): Mach-O executable i386 /usr/local/bin/ruby (for architecture ppc): Mach-O executable ppc ~ $ sudo gem install johnson -v "2.0.0.pre3" Building native extensions. This could take a while... ERROR: Error installing johnson: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb checking for jsautocfg.h in /usr/local/lib/ruby/gems/1.8/gems/ johnson-2.0.0.pre3/vendor/tracemonkey... no checking for jsapi.h in /usr/local/lib/ruby/gems/1.8/gems/ johnson-2.0.0.pre3/vendor/tracemonkey... no creating Makefile
make g++ -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.11.1 -I/usr/local/lib/ ruby/1.8/i686-darwin8.11.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE - fno-common -O2 -arch i686 -arch ppc -fno-common -pipe -fno-common - g -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion - Wmissing-noreturn -Winline -DXP_UNIX -c context.cc In file included from context.h:4, from context.cc:1: tracemonkey.h:9:19: error: jsapi.h: No such file or directory tracemonkey.h:10:20: error: jshash.h: No such file or directory etc
That was after trying a few different versions before that ... so it took less time to fail. The thing is, I can see the jsapi.h and the rest. I don't want to spend an age on Johnson - this week anyway - but it would be cool to have the full McCoy if it's possible. If not, I'll go in another direction.
> g++ -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.11.1 -I/usr/local/lib/ > ruby/1.8/i686-darwin8.11.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE - > fno-common -O2 -arch i686 -arch ppc -fno-common -pipe -fno-common - > g -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion - > Wmissing-noreturn -Winline -DXP_UNIX -c context.cc > In file included from context.h:4, > from context.cc:1: > tracemonkey.h:9:19: error: jsapi.h: No such file or directory > tracemonkey.h:10:20: error: jshash.h: No such file or directory > etc
I'm not sure why, but that command looks bogus. The '-I.' right before the '-D_XOPEN_SOURCE' is not right: it should point to the vendored tracemonkey, not '.'.
There are two differences between what you have and what I build/test against: I have a 64 bit install and I don't use the native ruby. PL22 seems pretty old. compared to current (at least what RVM installs), which is PL249. 2008-06-20 was quite awhile ago. I wonder if the ext build stuff was broken?
Would using a newer ruby (say, via rvm), be possible for you?
> > g++ -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.11.1 -I/usr/local/lib/ > > ruby/1.8/i686-darwin8.11.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE - > > fno-common -O2 -arch i686 -arch ppc -fno-common -pipe -fno-common - > > g -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion - > > Wmissing-noreturn -Winline -DXP_UNIX -c context.cc > > In file included from context.h:4, > > from context.cc:1: > > tracemonkey.h:9:19: error: jsapi.h: No such file or directory > > tracemonkey.h:10:20: error: jshash.h: No such file or directory > > etc
> I'm not sure why, but that command looks bogus. The '-I.' right before the > '-D_XOPEN_SOURCE' is not right: it should point to the vendored tracemonkey, > not '.'.
> There are two differences between what you have and what I build/test > against: I have a 64 bit install and I don't use the native ruby. PL22 seems > pretty old. compared to current (at least what RVM installs), which is > PL249. 2008-06-20 was quite awhile ago. I wonder if the ext build stuff was > broken?
> Would using a newer ruby (say, via rvm), be possible for you?
> -- > To unsubscribe, reply using "remove me" as the subject.
-- 23 Paxton Road, London SE23 2QG 02082442459 07906768867
> Embarrassing, using rvm's latest 1.8.7 seems to have fixed it.
> Should have spotted that but thanks.
> On 13 April 2010 20:41, Steven Parkes <smpar...@smparkes.net> wrote:
> > > g++ -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.11.1 -I/usr/local/lib/ > > > ruby/1.8/i686-darwin8.11.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE - > > > fno-common -O2 -arch i686 -arch ppc -fno-common -pipe -fno-common - > > > g -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion - > > > Wmissing-noreturn -Winline -DXP_UNIX -c context.cc > > > In file included from context.h:4, > > > from context.cc:1: > > > tracemonkey.h:9:19: error: jsapi.h: No such file or directory > > > tracemonkey.h:10:20: error: jshash.h: No such file or directory > > > etc
> > I'm not sure why, but that command looks bogus. The '-I.' right before the > > '-D_XOPEN_SOURCE' is not right: it should point to the vendored tracemonkey, > > not '.'.
> > There are two differences between what you have and what I build/test > > against: I have a 64 bit install and I don't use the native ruby. PL22 seems > > pretty old. compared to current (at least what RVM installs), which is > > PL249. 2008-06-20 was quite awhile ago. I wonder if the ext build stuff was > > broken?
> > Would using a newer ruby (say, via rvm), be possible for you?
> > -- > > To unsubscribe, reply using "remove me" as the subject.