Hacking Less Wrong made easy: Vagrant edition
The Less Wrong Public Goods Team has already brought you an easy-to use virtual machine for hacking Less Wrong.
But virtual boxes can cut both ways: on the one hand, you don’t have to worry about setting things up yourself; on the other hand, not knowing how things were put together, having to deal with a “black box” that doesn’t let you use your own source code editor or pick an OS—these can be offputting. To me at least, these were trivial inconveniences that might stand in the way of updating my copy of the source and making some useful tweaks.
Enter Vagrant—and a little work I’ve done today for LW hackers and would-be hackers. Vagrant is a recent tool that allows you to treat virtual machine configurations as source code.
Instead of being something that someone possessed of arcane knowledge has put together, a virtual machine under Vagrant results from executing a series of source code instructions—and this source code is available for you to read, review, understand or change. (Software development should be a process of knowledge capture, not some hermetic discipline where you rely on the intransmissible wisdom of remote elders.)
Preliminary (but tested) results are up on my Github repo—it’s a fork of the offiical LW code base, not the real thing. (One this is tested by someone else, and if it works well, I intend to submit a pull request so that these improvements end up in the main codebase.) The following assumes you have a Unix or Mac system, or if you’re using Windows, that you’re command-line competent.
Hacking on LW is now done as follows (compared to using the VM):
The following prerequisites are unchanged: git, Virtualbox
Install the following prerequisites: Ruby, rubygems, Vagrant
Download the Less Wrong source code as follows: git clone git@github.com:Morendil/lesswrong.git
Enter the “lesswrong” directory, then build the VM with: vagrant up (may take a while)
Log into the virtual box with: vagrant ssh
Go to the ”/vagrant/r2″ directory, and copy example.ini to development.ini
Change all instances of “password” in development.ini to “reddit”
You can now start the LW server with: paster serve—reload development.ini port=8080
Browse the URL http://localhost:8080/
- 18 Jun 2013 8:29 UTC; 20 points) 's comment on Learning programming: so I’ve learned the basics of Python, what next? by (
- 25 May 2015 23:57 UTC; 9 points) 's comment on Ideas to Improve LessWrong by (
- 30 Jan 2014 11:04 UTC; 2 points) 's comment on Volunteering programmer hours / discussing how to improve LessWrong’s software by (
- 1 Feb 2015 16:01 UTC; 0 points) 's comment on Open thread, Jan. 26 - Feb. 1, 2015 by (
- 17 Oct 2013 4:18 UTC; 0 points) 's comment on Rationality Quotes October 2013 by (
Talk about trivial inconveniences—when I try to get vagrant with gem I get
… and looking up explanations it seems I don’t have the right version of ruby, and most explanations on how to do that seem to be about installing a new ruby and not upgrading the one on my system, and when I try to use my mac’s “Mac OS X Software” option to try to update the system ruby it takes me to a webpage that wants to sell dashboard widgets.
At this point I have too many tabs open and it’s bedtime.
Which version of Ruby do you have? Macs ship with 1.8.2 (Tiger), 1.8.6 (Leopard) or 1.8.7 (Snow Leopard).
The advice I’ve seen for this error is to get the latest version of Rubygems, not Ruby: http://rubygems.org/pages/download
Right, it’s more likely a problem of the version of gems and not of ruby (I think I have Leopard—I’m not on my home machine now).
When running
… I got the same error as above, so I guess I’ll have to manually download it and install it and hope that the new one will become the default version (I’m somewhat wary of doing that, I don’t like having several versions of the same software on one machine).
Edited: add a step I’d forgotten (change password in development.ini)