Skip to content

Setting Up Your Development Environment

Tom Ash edited this page Feb 1, 2018 · 15 revisions

Getting Started

Step 1: Install VirtualBox and Vagrant

Step 2: Make the Virtual Machine

Before you begin, make sure you're developing on a case-sensitive filesystem. This is almost certainly the case for Linux users.

If you're on OS X, make a case-sensitive disk image. (Bing it to find out how.) Then cd to that disk image, then get the EA Forum development copy:

git clone https://github.com/tog22/eaforum.git

Then cd eaforum to go to the directory you just downloaded

Step 3: Run the following submodules

Within said directory, check out the submodules (except config/cap-tasks, which is only relevant for production):

git submodule init
git submodule deinit config/cap-tasks
git submodule update

Step 4: Run the Vagrantfile

You installed Vagrant in step 1. Staying in the root directory of the repository, run vagrant up, then wait a little. It may take a while. (Typical runtimes on Alex's laptop are 10-20 minutes.)

Errors and Solutions

ERROR: pkg5 is not a legal parameter in an Ansible task or handler
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Ensure that you're using the latest version of Ansible (ansible --version should be at least 2.1).

TASK [Create lesswrong DB user] ************************************************
fatal: [default]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user. For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}

Add this line to ansible.cfg (run ansible --version to find the path on your machine):

allow_world_readable_tmpfiles = True

Step 5: Start the Actual Server

Start the paster server:

/path/to/eaforum$ vagrant ssh
vagrant@precise64:~$ cd /vagrant/r2
vagrant@precise64:/vagrant/r2$ paster serve --reload development.ini

If you see 2015-07-05 23:00:23 : WSGIServer starting up, that means the server is running -- go to the next step.

Here's an example of the command history from all the above steps, and the full terminal output from this.

Step 6: Browse

You can now point your browser to http://localhost:8080 and get sensible-looking pages. An admin user has been created with a default password of swordfish.

Step 7: Run Tests

A partial implementation of manual tests is located in test/manual.txt; see issue #35 for the issue relating to automated testing.

Step 8: Contribute!

TrikeApps updates the site based on pull requests through GitHub - Peter is handling these at the moment.

Additional Resources

  • You can see questions and answers with a Less Wrong developer here (note that the deadline has passed for the prize described in the post).