EDIT: I’ve posted an easier version of this setup routine.
After many failed attempts to get Cloud9 up and running on ubuntu, someone finally posted some decent installation instructions. Andre used archlinux, so i thought I would try to do the same with ubuntu.
Below is the sequence of steps i followed to get up and running:
- Install Ubuntu 10.10 i686, choose any of the following:
- Local install
- Cloud based install amazon ec2, rackspace, etc
- Virtual Machine with VMware, Parallels, Virtual PC, etc
- I chose to use VMware Server 2.0 (formerly GSX server) for no other reason than I have used it before. It is free and quite powerful. I can never get bridged networking to work with wireless network on the host, so i plugged a cheapo separate wireless-network adapter into my laptop and configured VMware to pass that through to ubuntu. Anyway use whatever method you want, just get to the ubuntu desktop/terminal with network access.
- Update ubuntu
sudo apt-get update
- Need to install various packages and tools in order to compile node, o3, cloud9, etc. The big one I missed here was libxml2-dev, o3 won’t compile without it, and it wasn’t exactly obvious for me that I need this particular package. Also, you probably won’t need all of these, YMMV.
sudo apt-get install -y build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
- Due to various folder permission errors you may get down the track, it’s worth setting up a local bin path to install nodejs into and add that path to bash
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc . ~/.bashrc mkdir ~/local - Setup nodejs. Now there are various ways of doing this, you could even try nvm. This is what worked for me. There are newer versions of node than v0.4.0 already (4.1, 4.2, 5.0-pre, etc) but it seemed stable enough for me so I stuck with it. Now not all these steps are necessary, e.g. test and –v, but i put them in just to keep my sanity in check. Set configure to ~/local makes sure we install node to the ~/local/bin path we setup earlier
git clone git://github.com/joyent/node.git
cd node
git checkout v0.4.0
./configure --prefix=~/localmake
make install
make test
cd ..
node -v
- Setup npm, I think this step is optional but we may need it down the track
curl http://npmjs.org/install.sh | sh
npm -v
- Setup cloud9. This doesn’t really seem to be very well documented, but the suggestion is to use the development branch of cloud9. This part will take quite a while to update all the submodules. You will probably get an error on bin/cloud9.sh, I really don’t know if it is necessary (it is mentioned in the cloud9 installation instructions)
git clone git://github.com/ajaxorg/cloud9.git
cd cloud9
git checkout devel
git submodule update --init --recursive
bin/cloud9.sh
cd ..
- Build o3. I had plenty of problems with this step due to not having libxml2-dev installed. This copies the new o3 binaries into cloud9
git clone http://github.com/ajaxorg/o3
cd o3
./tools/node_modules_build
cp build/default/o3.node ../cloud9/support/jsdav/support/node-o3-xml-v4/lib/o3-xml/cd ..
- Create a new directory for your project ~/yourproject and add an app.js file containing
var http = require('http');
http.createServer(function (req, res) {res.writeHead(200, {'Content-Type': 'text/plain'});res.end('Hello World\n');}).listen(3001, "0.0.0.0"); - Almost there. You should now be able to run cloud9 like so (although switches are optional)
node ~/cloud9/bin/cloud9.js -w ~/yourproject
- Now you should be able to open up the cloud9 ide @ http://127.0.0.1:3000
- Now not everything is perfect (ctrl-s doesn’t save you file, instead calls up the firefox save as dialog for me for some reason), but it’s good enough for me to live with.
- Lastly, why do this instead of using the free, already configured cloud9ide.com? Well this allows me to control everything, as well as run commands like the coffeescript cli, etc
Good luck!
You may want to hit up the cloud9 ide google group if you have issues