HomebrewでSpiderMonkeyをインストール
今更ながらコンソールでJavaScriptを実行するために。
以前やろうとしたときはたぶんHomebrewに慣れてなかったから挫折したんだろうなー。
➜ ~ brew install spidermonkey ==> Installing spidermonkey dependency: nspr ==> Downloading http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz ######################################################################## 100.0% ==> ./configure --prefix=/usr/local/Cellar/nspr/4.8.8 --enable-strip --enable-optimize --enable-64bit ==> make ==> make install Warning: Non-executables were installed to "bin". Installing non-executables to "bin" is bad practice. The offending files are: /usr/local/Cellar/nspr/4.8.8/bin/prerr.properties ==> Summary /usr/local/Cellar/nspr/4.8.8: 99 files, 1.5M, built in 28 seconds ==> Installing spidermonkey ==> Downloading http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz ######################################################################## 100.0% ==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.13.tar.gz ######################################################################## 100.0% ==> ./configure --program-suffix=213 --prefix=/private/tmp/spidermonkey-bAim/js-1.8.5/ac213 ==> make install ==> /private/tmp/spidermonkey-bAim/js-1.8.5/ac213/bin/autoconf213 ==> ../js/src/configure --prefix=/usr/local/Cellar/spidermonkey/1.8.5 --enable-readline --enable-threadsafe --with-system-nspr ==> make ==> make install ==> Caveats This formula installs Spidermonkey 1.8.5. If you are trying to compile MongoDB from scratch, you will need 1.7.x instead. ==> Summary /usr/local/Cellar/spidermonkey/1.8.5: 101 files, 11M, built in 4.0 minutes ➜ ~ js zsh: correct 'js' to 'jps' [nyae]? n js> print('Hello' + 'World.'); HelloWorld. js> quit(); ➜ ~