ruby-debug19 on Ubuntu 10.04 (with rvm) 0

Posted by dave
on Thursday, September 09

Note to self: the newest available version of ruby-debug19 will fail brutally like this on the Ubuntu 10.04:

$ ruby -Ilib:test test/controllers/test_my_account_controller.rb 
/home/dave/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24/lib/ruby-debug-base.rb:1:in `require': no such file to load -- ruby_debug.so (LoadError)

To avoid this unpleasant fate, uninstall the latest versions of ruby-debug19 and ruby-debug-base19 (which are both at 0.11.24):

gem uninstall ruby-debug19
gem uninstall ruby-debug-base19

For some reason, that didn’t do the trick for me and I also had to manually remove the installed gem files from rvm’s gems folder:

rm -Rf ~/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24/

After that, the gem installed just fine, one patch point back:

gem install ruby-debug-base19 -v=0.11.23
gem install ruby-debug19

Installing CouchDb 1.0.1 on Ubuntu 10.04 0

Posted by dave
on Friday, September 03

CouchDb 1.0.1 is hard to install from source on Ubuntu 10.04, mainly because the libmozjs-dev package doesn’t exist in the apt repos. If you try following the CouchDb install from source directions, you’ll get a message like this:

configure: error: Could not find the js library.
Is the Mozilla SpiderMonkey library installed?

CouchDb relies on Mozilla’s SpiderMonkey javascript engine, but that’s not available in Ubuntu 10.04.

This should install most dependencies:

sudo apt-get build-dep couchdb

In case build-dep didn’t get this one:

sudo apt-get install xulrunner-dev

Grab the SpiderMonkey source from the Mozilla website, build it, and install it:

wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz
tar -xvzf js-1.8.0-rc1.tar.gz
cd js/src
make BUILD_OPT=1 -f Makefile.ref
sudo make BUILD_OPT=1 JS_DIST=/usr/local -f Makefile.ref export

That’ll build and install libjs – but after a reboot, couchdb may lose track of where you’ve installed libjs. You could mess around with environment variables every time you spark up couch, but you might want to make it more permanent by informing ldconfig of the library’s location. Assuming you’re on 64-bit, you can do this:

sudo touch /etc/ld.so.conf.d/spidermonkey.conf
sudo echo "/usr/local/lib64" >/etc/ld.so.conf.d/spidermonkey.conf
sudo ldconfig

Adjust as necessary for 32-bit systems if you’re running one of those.

After that you should have no trouble grabbing the CouchDb source, untarring it, and doing the configure-make-make-install dance:

wget http://apache.mirror.anlx.net//couchdb/1.0.1/apache-couchdb-1.0.1.tar.gz
tar -xvzf apache-couchdb-1.0.1.tar.gz
cd apache-couchdb-1.0.1
./configure && make && sudo make install