HOWTO: Ruby on Rails on your Nokia N800
I got a few emails asking me how I did it. So why not do a HOWTO on the site right?
It’s pretty simple but I have yet to see a howto on this at least one that goes from start to end. I thought I do it even at the risk of repeating someone else instructions. I know I will have these here for myself and anyone else that might need to know how to do it.
First make sure you have the latest firmware for your Nokia N800. Now I did this on a N800 I have never touched a N770 but I am sure if you have the hacked 2007 OS then this howto will apply for that as well. So you will need the latest IT OS 2007.
Before you start please note that install Ruby on Rails can be a long process even though I make it seem fast here it can seem at times like it has locked up your N800 … just let it do it’s thing and you will end up with a portable RoR developing machine
. Remember give it time!
If you haven’t done so you might want to add some virtual memory to your N800. How you do this is by going to your control panel and click on memory. Once the dialog comes up click on the virtual tab. Now add as much virtual memory as you can. Please remember to place the memory card near the battery this is what the N800 uses for it’s virtual memory.
You will need to enable “Red Pill” mode … what does this mean? Basically it unlocks the Repository’s you have under Application Manager so you can install OpenSSH(or SSH).
So to enable Red Pill mode do this:
- Open Application Manager
- Click on the Application Menu(upper left hand corner)
- Click on Tools and then click on Application catalog
- Click on the New button
- In the Web Address delete http:// and type in matrix
- Click on Cancel
- This will bring up a prompt with Red Pill or Blue Pill, click on Red Pill.
- You can now click on the Close button for the catalog and you will be able to see a larger list of applications to install.
- Optional … If you do not see more applictions listed then you might have to refresh the catalog which is listed under the tools menu.
What do you need installed? Not much just a few things. X Terminal (osso-xterm) and SSH.
- Click on Browse installable applications
- Click on the All button
- Look for osso-xterm and ssh click on each one and click on install. You will have to do it for each package.
- Close Application Manager
You should now have Xterminal and SSH installed
.
Last steps
I promise.
Open your Browser on your N800 and type this in http://pierre.droids-corp.org/maemo/ (or this one from your computer ) from there install the ruby_1.8.5, rubygems_0.9.2, and sqlite3-ruby_1.2.1 packages. Now you should have Ruby and Rubygems installed.
Open up X terminal type this in ssh root@localhost it will ask for a password type in rootme. Your now root on your N800. I suggest you run an update on your Rubygems so type this in:
gem update --system
This will run thru a process of updating your rubygem. If you encounter a error just run the command again it should follow thru after that.
Now to install Rails
. Type
gem install rails --include-dependencies
this will install rails and any other needed files that are required by rails. Again if you encounter an error just type the command in again.
That’s it you have Ruby and Rails install now.
I have a few things installed that you might want to install yourself to help you work with your Rails app. Minimo which is a ported version of Mozilla for portable devices and I have leafpad installed. The built in browser has it’s limitations and using Minimo will get you closer to using a more featured pack browser that will handle Advanced JavaScript such as AJAX and advanced CSS.
It can be hard to type code on the N800 but you can use a bluetooth keyboard for that
it works very well.
I hope I didn’t leave anything out if I did let me know … I am really good at missing the small stuff :P, Good luck!
EDIT: I added a plugin to my wordpress that should now display the shell commands better. It was merging the 2 dashes into one long one. Sorry for the confusion everyone.
Related posts:
- Ruby on Rails on the Go! About 4 days ago I managed installing Ruby on Rails...
- Ruby on Rails community support … sucks! I can’t believe how hard it is to get a...
- Mootools Videos still coming! Don’t worry I am still planning on it. As a...
- New website and Open Source Project! Hey I am working on a new website called Phoky....
- Developing … a Love and Hate relationship I hate Developing! Developing is not the most favorite thing...




















Didn’t work for me. I got the red pill, updated the catalog, and there was no ssh or xterm. Any new ideas?
zach, which repositories do you have applied to your application catalog? I will admit I have more then the default repositories so maybe we need another repo added to enable it
.Let me know!
gem update –system and all other forms of gem update fail with ‘Killed’. Where might logfile be? I tried verbose mode and get no extra output…natch.
I really wish that Wordpress would display the code right. Mike it should be done with 2 dashs –> gem update –update
I am going to to see if I can get a plugin for wordpress that will display code better.
Sorry about that mix up.
BusyBox v1.1.3 (Debian 3:1.1.3-3.osso17) Built-in shell (ash)
Enter ‘help’ for a list of built-in commands.
Nokia-N800-51:~# whoami
root
Nokia-N800-51:~# gem update –system
Updating RubyGems…
Bulk updating Gem source index for: http://gems.rubyforge.org
Attempting remote update of rubygems-update
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find rubygems-update (> 0) in any repository
Nokia-N800-51:~# gem update
Updating installed gems…
Bulk updating Gem source index for: http://gems.rubyforge.org
Gems: [] updated
Nokia-N800-51:~# gem update -update
ERROR: While executing gem … (OptionParser::InvalidOption)
invalid option: -update
Nokia-N800-51:~#
Note that gem did install…and somehow today I seem to be able to issue:
BusyBox v1.1.3 (Debian 3:1.1.3-3.osso17) Built-in shell (ash)
Enter ‘help’ for a list of built-in commands.
Nokia-N800-51:~# gem install rails –include-dependencies
Successfully installed rails-1.2.3
Successfully installed rake-0.7.3
Successfully installed activesupport-1.4.2
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3
Installing ri documentation for rake-0.7.3…
Installing ri documentation for activesupport-1.4.2…
Installing ri documentation for activerecord-1.15.3…
It seems to be hanging on last step…either there’s a HELL of a lot of docs or…
Sorry about format of last post…my CR/LFs didn’t seem to make it in for paragraph spacing.
Still hung on last install doc step…ruby taking >97% cpu and 45% memory.
Whew…that took a while. Install of ror was like 30-60mins and I do have fast cable connection.
Finally got “gem update –system” to work…said I needed to update 2 gems and is now rebuilding/installing more stuff.
It hogged cpu from 50-95% the entire time. Wasn’t adding much to disk space during this time either.
Yes it can take awhile and be a resource intensive thing at first but I had it do the last steps at night when I went to bed. Left the stand up so it would get some air incase it got hot. In the morning everything was complete.
The N800 is something you have to have patience with if you don’t you end up chucking it across the room
. Hopefully everything ends up working out for you on the N800 and RoR
.
I will add a note saying it will take awhile to do the process
.
Greetings
I kinda like the idea of dabbling with some RoR on my N800 so I downloaded ruby, gems and sqlite and installed them.
I then started the process of updating gems using gem update –system via ssh on the n800 and it starts does a little beginning bulk update and then crashes and restarts my device?
I tried running the update from my mac via ssh and get the same results?
Anyone else experiencing this sort of issue?
thanks in advance
Dave
Dave did you download the packages from http://pierre.droids-corp.org/maemo/ ? It should have worked if you did since those are packages just built for the N770/800 series. I have not experienced the device rebooting I have had it error out on me while updating but I ran the system update once more and it fixed it.
What are the steps your doing to install RoR? Did you follow the steps above or did you go some other route?
When I ran gem update I got
Error fetching remote gem cache: Errno::ENOSPC reading http://gems.rubyforge.org/yaml
Gene did you run the command more then once? That error is typically normal when updating the gems.
Greetings again
It would appear that the n800 restart only happened once as a result of running the gems update, every other time X Term crashes out.
So I figured I’d switch on my virtual memory 128 meg to the internal card etc . . .
The update ran a lot longer now and I watched as the cpu/mem applet ramped up; the mem part of it beyond the 50% mark.
I then got a message similar to what Mike was getting :
Could not find rubygems-update (> 0) in any repository
and then after a while X Term crashed back to my home page.
Gonna reboot and try again.
With the addition of virtual memory methinks I should succeed.
Will post back later.
Ta
Dave
Well yeah I do have my virtual memory at the most I can give it. I will have to make a note of that then. The “Could not find rubygems-update (> 0) in any repository” that error is common just run the gem update –system once again and it will cache the gem repo.
Hopefully that memory is the problem and adding my virtual memory solves it for you
.
Much better . . . gem -v reports that 0.9.4 is now installed. Took a couple of attempts running the update. Now on to doing the rails bit.
Thanks
Dave
Success . . . .
Nokia-N800-10:~# gem -v . . .
0.9.4 . . .
Nokia-N800-10:~# rails -v . . .
Rails 1.2.3 . . .
Now what to do ?
Thanks KNK will have a play with this sometime. Was thinking of trying Tracks on it for some GTD stuff.
FYI : http://www.rousette.org.uk/projects/
Ta
Dave
Dave i like to keep it simple –> http://todotxt.com/ … working on a blog for todo.sh
.
That looks interesting, I will have a look at that when I get a mo. Looks like a nice clean solution. Kinda lacks detail to the point of references; but as a little jog to the memory for outstanding actions that would work nicely. Thanks Dave
II ran the command six times and got the same error message, mentioned above. I reflashed my system and went thru the same process and got the same error message, after trying to do the gem update as specified. Whenever I have tried it I tried the same command multiple times.
II ran the command six times and got the same error message, mentioned above. I reflashed my system and went thru the same process and got the same error message, after trying to do the gem update as specified. Whenever I have tried it I tried the same command multiple times.
Here is the entire error message
/home/user # gem update –system
Updating RubyGems…
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem … (Gem::RemoteSourceException)
Error fetching remote gem cache: Errno::ENOSPC reading http://gems.rubyforge.org/yaml
Gene, how much Virtual Memory do you have? Make sure you have setup a memory card with some virtual memory. This seems to solve that problem with most people.
After uploading new firmware onto N800…sigh…starting all over again.
After reflash I to have vmem setup…128MB max. Killed and am recreating vmem. I thought default was NO vmem?
Before recreate of vmem I was getting ENOSPC error…now after recreate I get “Could not find…( > 0) in any repository.”
But…you must remember you will need to run this command MANY times possibly…it is now working again.
So after firmware upgrade…possibly try recreating your vmem and you should be good to go running above cmds.
spoke too soon…I get errors during rail install that I didn’t get before. Re-install doesn’t seem to work…perhaps I will remove all and try again but I think this may be due to new firmware.
Nokia-N800-26:~# gem install rails –include-dependencies
Successfully installed rails-1.2.3
Successfully installed rake-0.7.3
Successfully installed activesupport-1.4.2
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3
Installing ri documentation for rake-0.7.3…
Installing ri documentation for activesupport-1.4.2…
/usr/lib/ruby/1.8/fileutils.rb:1285: [BUG] not a node 0×05 (0×19b50)
ruby 1.8.5 (2007-03-13) [arm-linux-eabi]
Aborted
Nokia-N800-26:~# gem install rails –include-dependencies
Successfully installed rails-1.2.3
Nokia-N800-26:~#
I’m back! I installed the new N800 firmware and ran gem update –system a bunch more times, making sure that I had the 128 Meg of virtual memory. I had the same results, with some variances. If I am the root user, I get exactly the same message I reported before:
Error fetching remote gem cache: Errno::ENOSPC reading http://gems.rubyforge.org/yaml
If I am not the root user, I get [BUG] Segmentation fault ruby 1.8.5 (2007-03-13) [arm-linux-eabi]
I come back here mainly because you are the best source for instructions on how to install ruby, but I keep trying the on rails stuff as well. Someday I hope to succeed
gene, why don’t you try to preload the gems on a flash card so you can remove networking from the equation?
It seems that the problem with the new firmware is the tmpfs which limited to 512kb. If you increase the maximum size of tmp you will stop getting this weird “Error fetching remote gem cache: Errno::ENOSPC reading” when you run the command as root. To increase the tmpfs maximum size give something like this:
mount tmpfs /tmp -t tmpfs -o size=16m
After that the process is continuing and without ending with this particular error. I also have noticed that you should not try to interact with the tablet during the process as it seems like some kind of Nokia’s protection mechanism is causing the device to reboot, because it thing that the device is not responding.
So simple avoid to touch your device during this process.
after a couple of tries, got it installed. (i did not launch Xterm on the n800, but ssh’d from my Mac and while this might functionally be the same, I am much faster and accurate typing than using the click-peck method of text entry–keyboard should be here soon… though I am tempted to cancel the order and get a new Mac wireless keyboard). Anyway, by doing this I can have additional terminal windows open and monitor the progress of the installation.
So now I guess I should begin to code…
Haven’t tried this on the n800, but normally if you add –no-ri –no-rdoc options to the gem commands, it will skip generating the docs, which basically takes all the time.
Better still, if you add the following line to ~/.gemrc docs will always be skipped:
gem: –no-ri –no-rdoc
Seggy, great idea. I knew about the command but didn’t know you can have it pre-steup already so it would ignore right off the bat. I am currently re-writing the tutorial on how to do this and that right there my friend will be in the tutorial. Thanks!
The biggest problem I had was updating rubygems. In the end the only way I could do it was to update manually by downloading the rubygem update the old fashioned way, installing it and using update_rubygem.
One thing to note is the 0.9.5+ version of rubygem is much much better on small memory devices so its worth upgrading this. Everything else just installs straight out of the box. I used:
wget http://rubyforge.org/frs/download.php/29547/rubygems-update-1.0.1.gem
gem install rubygems-update-1.0.1.gem
update_rubygems
gem install rails –no-ri –no-rdoc
Rubygems took about 10 minutes to install because I forgot the –no-ri/–no-rdoc switches, rails took much less
HTH
Hi, thanks for the great instructions : )
I successfully installed Ruby and Rails on my N800 from SSH on my PC.
When I try to start ./script/server I get a “~sh: ./script/server: Permission denied” error.
This happens whether or not I’m root, and doesn’t matter if I’m using XTerm on the N800 or SSH on the PC.
Any suggestions?