Friday, August 31, 2007

Installing Aptana+RadRails plugin on ubuntu

I have taken all the pain installing Aptana 0.2.9(with radrails) on my ubuntu 7.04 machine and would like to present a better way of Aptana installation.

Following are the steps to be followed to get Aptana installed (with rails support) on ubuntu.

All the downloads are pointed to foo's desktop which is equivalent to the directory /home/foo/Desktop (foo is the user-name of
the current user of the system)

1. Download Aptana for linux from "http://www.web20.com/downloads/current/Linux/VM/Aptana_IDE_Setup.bin" to yuor Desktop.

2. After the download gets finished, open a terminal. Open /etc/apt/sources.list and make sure you have the universe
repository enabled:

sudo gedit /etc/apt/sources.list

deb http://de.archive.ubuntu.com/ubuntu/ edgy universe

3. If you had to modify /etc/apt/sources.list, you must update the package database afterwards:

sudo apt-het update

4. Aptana depends upon the following two packages. So, You need to install these as

sudo apt-get install mozilla libswt3.1-gtk-java

this will throw some error messages but dont take a note of that.Those errors rise because of the newer versions of those libraries
that already exist on the machine.

5. Now start the installation as

/bin/bash Aptana_IDE_Setup.bin wil throw some errors as

falko@falko-desktop:~/Desktop$ /bin/bash Aptana_IDE_Setup.bin

Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
nawk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

Launching installer...

grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/tmp/install.dir.7470/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open
shared object file: No such file or directory

If you get these error messages, do the following...

cp Aptana_IDE_Setup.bin Aptana_IDE_Setup.bin.bak
cat Aptana_IDE_Setup.bin.bak | \
sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > \
Aptana_IDE_Setup.bin

6. Aptana Installer will come up. Now accept the defaults and click on "Done" to finish the installation.

7. Create a script to set an environment variable (MOZILLA_FIVE_HOME) for Aptana and place it in /usr/bin

for that do the following: gedit aptana

this opens an empty text file named aptana in the gedit editor. Now place the following script in the opened file .

#/usr/bin
export MOZILLA_FIVE_HOME=/usr/lib/mozilla
~/Aptana/aptana

8. Now letrs make the file executable and place it in /uer/bin directory.For that

chmod 755 aptana
sudo mv aptana /usr/bin/

Aptana is now installed.


To create a menu entry for Aptana, just follow me :

9. Download the aptana icons from "http://www.aptana.com/trac/attachment/ticket/702/icons.zip" .

10. Extract the icons to yuor desktop.Move these icons to /usr/share/pixmaps/

sudo mv aptana_* /usr/share/pixmaps/

11. Right-click on Applications and select Edit Menus:

In the programming subcategory, click on "New Item".

In the Menu Item Properties window that pops up, fill in the following details:

Name : Aptana
Comment : Aptana
Command : aptana or /usr/bin/aptana (this is the script you have written earlier)

Now click on "No Icon" button.
In the file browser, navigate to /usr/share/pixmaps and select the aptana_32x32.png icon. Click on OK:
You will now see the Aptana icon in the Menu Item Properties window. Click on OK:
Then close the Menu Layout window:

12. Go to Applications -> Programming , you will find Aptana . Click on the Aptana to start Aptana.


If you are unable to start aptana, I have a work-around for that. In Step 11:

for the Command : /home/foo/Aptana/Aptana_IDE_Beta/Aptana

The directory /home/foo/Aptana is the directory where Aptana is installed. If Aptana is installed to some othet directory
you need to feed that path.

Now repeat the Step 12 . Aptana should be starting this time...


Now lets discuss configuring "RadRails" plugin for Aptana...

13. Note that if you are behind a proxy , you need to configure that. To do so,

go to Window -> preferences -> install/update , check the box to the right of "Enable Http proxy connection" and fill the
details and click on "Apply" and "OK"

14. Go to Help -> Software Updates -> Find and Install -> Search for new features to install and click on "Next"

Select the "Ruby on Rails Development Environment" and click on "finish" and just follow the dialogue prompts to complete
the installation.

Now when you restart Aptana you will be able to see RadRails perspective.

15. Like wise you can also install the "Subclipse" just as you have installed "RadRails" in the above step.


Thats all...I think every thing should be working fine now...

If you still face any problems, feel free to post a comment in the blog.

thanks and regards,
Venkat.