Full ruby and gems on n900 Maemo 5

Okay, here’s the short story for the question why!?
I wanted the n900 so bad since I saw it was announced, cause I used the previous nxxx models and they kicked butt but all they missed was a goddamn phone. Sadly I’ve got it several years later cause it was too goddamn expensive! Anyways I fiddled with it for a few days and I got all the apps I ever dreamed of on a phone running except the ones I really miss from an Android phone and these are google-maps and dropbox. Well I found the dropn900 but it didn’t seem to work because I probably messed something up leaving me some errors I already forgot about in the log file and later on I was missing an SSL module from python. I guess after several  system updates I got the python compiled without ssl, and I had python libssl and openssl packages… I got bored finding a solution to that and said to myself! I’ll make my own app in a minutes cause there is dropbox cli example written in ruby! Yeah right…

Well it was all awesome and swell in a form of  idea but then I realized I needed rubygems to install the drobox-sdk.
And to install rubygems i needed ruby-dev, and to install ruby-dev i needed libc6-dev, and to install libc6-dev I needed gcc to compile ruby modules written in C.  Oh the fiasco!

Now to the solution:

First of you need to install GCC on your n900, to install that you’ll need the GCC packages that are compatible with your libc6 version. Before you start installing GCC make sure you’ve got the extras-testing and extras-devel repo in your sources list. There is a nice guide on installing GCC by Denver Gingerich located here.

Download these packages:

For gcc you’ll need these packages:

For g++, you’ll also need these packages:

Then copy the packages to your device and dpkg -i all of them except the last two. The order is a bit mixed but it is a nice hunch to get you started. The last two packages are dependent of each other so unpack them first with dpkg –unpack and then configure them with dpkg –configure -a. They should be installed now.
Now I had a little libc6-dev version  mismatch  (The package above is 2.5.1-1eglibc20+0m5 and I needed 2.5.1-1eglibc27+0m5, as you can see it is a small mismatch) so if you get any of that correct the DEBIAN/control of your package to fit your needs or just force the package installation.

Here’s how you edit dependencies of a .deb package:

Make a temp folder with mkdir
Extract deb package with dpkg-deb -x <package> <temp folder>
Extract control files of a deb package with dpkg-deb –control <package> <temp folder>/DEBIAN
Edit the control file with nano <temp folder>/DEBIAN/control
Build the package again with dpkg -b <temp folder> <name of the package>.deb

Now copy the package on your device and install it. Now you should be super-awesome fine with all you need to do apt-get install ruby-full and install all of required packages of that meta package.

You think now you can sing: 


You now need rubygems1.8 package to install gem packages and that package wasn’t in maemo repos I have (“Could it be, could it be that you are joking with me!?”)
Ok, now you go to the Debian repo and get that bastard! It doesn’t have much dependencies and all those packages you already have.


And here you go! You can now sing 

Oh, noez, NOT JUST YET! Remember that you had to install GCC so you can install ruby modules written in C, now to be able to do that you’ll need apt-get install make!
But make will say: make: cc: command not found error at line 127 or something like that. The system doesn’t know where is gcc so you can solve this with a simple script nano /usr/bin/gcc

gcc $@

And this means that when cc is called all args will be passed to gcc, simple as that.

Now you can rock on and groove to

 and install all those precious gems.
I’ll be playing with dropbox-sdk… as I see cli_example.rb has a lot of gem issues so I’m installing them right now… hope that everything will be alright. Aaaaaaand it is done! Freakin’ finally! :D


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: