During the last period I've learned a lot about boards that can be used in Embedded Projects (Arduino, Raspberry Pi, BeagleBone Black ...). The last one has an interesting feature that has caught my attention. The possiblity to install a web ide that can be accessed from other devices.
Starting from this I've asked myself
Can I do that with the Raspberry Pi that I already own?
Cloud9 is developed using some technologies, the most important is Node.js
I've found a lot of tutorial about installing Cloud9 on Raspberry Pi, but due to the fast evolving situation I've found a lot o problems during the process.
For this reason I've decided to write this tutorial to avoid other people to waste time.
First Step install the OS on the SD:
I've decided to use Debian Wheezy given its stability and diffusion. You can find it (With installation istructions) at raspberrypi.org
Second Step install Node.js:
In the first time I was tempted to uso the fast and recent version 0.10.x or the one from the repository 0.6.x, I've chosen ti use the 0.8.17 for a simple reason, using too old or too new versions of Node.js Cloud9 do not install correctly, at least I've failed in doing so (if you have other experiences post it in the comments below)
- sudo apt-get update && sudo apt-get -y upgrade
- sudo apt-get -y install build-essential openssl libssl-dev pkg-config libxml2-dev
- cd ~
- wget http://nodejs.org/dist/v0.8.17/node-v0.8.17-linux-arm-pi.tar.gz
- cd /usr/local
- sudo tar xzvf ~/node-v0.8.17-linux-arm-pi.tar.gz --strip=1
- export NODE_PATH="/usr/local/lib/node_modules"
This commands do update the system, they install necessary prerequisites, they download Node.js e and they install it in the folder /usr/local
Third Step download Cloud9:
For this step we use git to download the latest sources from github
- git clone https://github.com/ajaxorg/cloud9.git cloud9
Fourth Step install node-libxml:
The standard version of node-libxml is not compatible with Raspberry Pi. For this reason we download the sources and adapt them in order to compile correctly.
- cd cloud9 && mkdir node_modules && cd node_modules
- git clone https://github.com/ajaxorg/node-libxml.git libxml
- cd libxml && git checkout v0.0.7 && git submodule init && git submodule update
- nano support/o3/wscript
at the end of this step the nano editor will show up. It is necessary to delete the configuration "-msse2" from the file (you can find it in a couple of well visible places). To save it CTRL+X followed by Y
We will now install node-libxml globaly (-g) (it requires from 15 to 20 minutes)
- sudo npm install -g
Fifth Step install Cloud9:
During this step we will use the utility npm.
Personal suggestion, before start the installation make a copy of the folder libxml just in case something go wrong during the process (I've had problems 2 times).
To do that:
- cd ~/cloud9
- sudo npm install
Fifth Step bis if something went wrong clean the folder node_modules and copy libxml in place.
Now try again
- sudo rm -r ./node_modeles/*
- cp ./libxml ./node_modules/libxml
- sudo npm install
Sixth Step fix vfs-local:
stopping here you will encounter a problem, a continuos message that states as follow "File already exists". To avoid it we will revert vfs-local back to a previous version.
- rm -r ./node_modules/vfs-local
- npm install firstname.lastname@example.org
Here we are at the end of our journey. If carma has helped you (if you trust in carma), If some saints has watched you (if you are a religious guy) or just if you are lucky you will have on your Raspberry Pi a working installation of Cloud9.
You just need to know how to start it:
- bin/cloud9.sh -l 0.0.0.0 -w ~/git/
Replace ~/git with the folder you want to use as workspace, or delete -w ~/git allowing Cloud9 to move around in the entire File System.
To access Cloud9 just open your brower (is better Chrome, Chromium or Firefox) and surf to the address http://<raspberry pi ip>:3131/
Here are the links to a couple of tutorial I've followed to build mine:
I hope this guide has helped you, do not esitate to post questions, clarification or just to say hello.