HOWTO: Ruby on Rails on your Nokia N800

Posted: May 27th, 2007 | Author: Jon | Filed under: blog | Tags: , , , , | 40 Comments »

NOTE: THIS IS INSTRUCTIONS FOR OS 2007 AND NOT 2008. For 2008 visit this site

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:

  1. Open Application Manager
  2. Click on the Application Menu(upper left hand corner)
  3. Click on Tools and then click on Application catalog
  4. Click on the New button
  5. In the Web Address delete http:// and type in matrix
  6. Click on Cancel
  7. This will bring up a prompt with Red Pill or Blue Pill, click on Red Pill.
  8. 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.
  9. 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.

  1. Click on Browse installable applications
  2. Click on the All button
  3. Look for osso-xterm and ssh click on each one and click on install. You will have to do it for each package.
  4. 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:

  1. Ruby on Rails on the Go! About 4 da
  2. Ruby on Rails community support … sucks! I can
  3. I love Sugar in my Espresso Earlier to
  4. Mootools Videos still coming! Don’


40 Comments on “HOWTO: Ruby on Rails on your Nokia N800”

  1. 1 The Ruby Way » Ruby on Rails on your Nokia N800 said at 7:50 am on June 2nd, 2007:

    [...] os??????????roo??? ????http://www.jonforrent.com/2007/05/27/howto-ruby-on-rails-on-your-nokia-n800/ Filed under: Rails — TAG: rails Related posts for the current post: 19 Rails Tricks [...]

  2. 2 zach said at 1:54 pm on June 2nd, 2007:

    Didn’t work for me. I got the red pill, updated the catalog, and there was no ssh or xterm. Any new ideas?

  3. 3 KNK said at 12:34 am on June 3rd, 2007:

    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!

  4. 4 Mike said at 12:20 pm on June 3rd, 2007:

    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.

  5. 5 KNK said at 8:41 pm on June 3rd, 2007:

    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.

  6. 6 Mike said at 11:04 pm on June 5th, 2007:

    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…

  7. 7 Mike said at 11:08 pm on June 5th, 2007:

    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.

  8. 8 Mike said at 11:58 pm on June 5th, 2007:

    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.

  9. 9 KNK said at 1:03 am on June 6th, 2007:

    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 :P . 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 :) .

  10. 10 Ruby on Rails on NIT at Internet Tablet Talk said at 12:30 pm on June 6th, 2007:

    [...] the developer was David Heinemeier Hansson, and the framework he was working on became Ruby on Rails (an accomplishment which led O’Reilly and Google to name him “hacker of the [...]

  11. 11 Dave said at 3:48 am on June 10th, 2007:

    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

  12. 12 KNK said at 12:52 am on June 11th, 2007:

    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?

  13. 13 Gene Venable said at 5:01 am on June 11th, 2007:

    When I ran gem update I got

    Error fetching remote gem cache: Errno::ENOSPC reading http://gems.rubyforge.org/yaml

  14. 14 KNK said at 8:14 am on June 11th, 2007:

    Gene did you run the command more then once? That error is typically normal when updating the gems.

  15. 15 Dave said at 12:34 pm on June 11th, 2007:

    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

  16. 16 KNK said at 1:14 pm on June 11th, 2007:

    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 :) .

  17. 17 Dave said at 2:07 pm on June 11th, 2007:

    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

  18. 18 Dave said at 2:42 pm on June 11th, 2007:

    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

  19. 19 KNK said at 4:05 pm on June 11th, 2007:

    Dave i like to keep it simple –> http://todotxt.com/ … working on a blog for todo.sh :) .

  20. 20 Dave said at 3:59 am on June 12th, 2007:

    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

  21. 21 Gene Venable said at 2:08 pm on June 17th, 2007:

    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.

  22. 22 Gene Venable said at 2:11 pm on June 17th, 2007:

    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

  23. 23 KNK said at 1:32 pm on June 19th, 2007:

    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.

  24. 24 Ruby Brasil » Blog Archive » Ruby on Rails no Nokia N800 said at 3:06 pm on July 2nd, 2007:

    [...] é! pode não ser muito útil (pelo menos por enquanto), mas este post revela como colocar o Rails para rodar no celular N800, da Nokia. Só faltou uma imagem para ver [...]

  25. 25 Mike said at 5:14 pm on July 7th, 2007:

    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.

  26. 26 Mike said at 6:07 pm on July 7th, 2007:

    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:~#

  27. 27 Gene Venable said at 9:44 pm on July 7th, 2007:

    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 :)

  28. 28 jherber said at 4:42 am on July 9th, 2007:

    gene, why don’t you try to preload the gems on a flash card so you can remove networking from the equation?

  29. 29 Le blog » Archive du blog » links for 2007-07-10 said at 5:24 pm on July 9th, 2007:

    [...] HOWTO: Ruby on Rails on your Nokia N800 Si j’investis dans un n800, ce sera sans doute l’une des premières choses que je ferais (la première étant bien entedu l’installation de Ruby) (tags: programming rails ruby tutorial n800) [...]

  30. 30 PePPeRV said at 2:04 am on July 11th, 2007:

    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.

  31. 31 Morethanseven » Ruby on Rails on Nokia N800 said at 10:26 am on July 15th, 2007:

    [...] followed along with a pretty good tutorial, although I already had Red Pill Mode, XTerm and SSH installed. Ruby is also now available in the [...]

  32. 32 Gnarvaez said at 12:20 am on August 12th, 2007:

    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…

  33. 33 Seggy said at 7:34 pm on August 15th, 2007:

    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

  34. 34 KNK said at 8:19 am on August 17th, 2007:

    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!

  35. 35 Marcus said at 6:25 am on January 4th, 2008:

    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

  36. 36 blog.decompiler.us » learning scripting languages, hands-on, from anywhere said at 10:01 pm on January 23rd, 2008:

    [...] much more good geekiness to be had from bubo and maemo.org.  i’ve seen various claims about installing and running ruby on rails on an n800 (why?  because you can!) as well as subversion and more.  [...]

  37. 37 Justin said at 7:13 pm on July 8th, 2008:

    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?

  38. 38 Continuation » Ruby on Rails on Maemo 2008 N810 said at 2:57 pm on November 16th, 2008:

    [...] Google gave me a nice How To from Jon Ferrent, it talks about N800 but it’s the [...]

  39. 39 Marc with N800 said at 9:00 am on February 14th, 2009:

    Hi,

    thanks for these instructions but I couldn’t get the install to work, it always crashed my N800 with Maemo 2008 during “gem update –system”.

    I found this addition lately:
    http://www.mobygeek.net/blog/2008/11/16/ruby-on-rails-on-maemo-2008-n810/

    To summarize:
    - install packages ruby_1.8.5 and sqlite3-ruby
    - uninstall rubygems if it’s installed
    - get latest zip file from http://rubyforge.org/frs/?group_id=126
    - unzip the package
    - cd to the unzipped directory
    - run this command as root: ruby setup.rb –no-ri –no-rdoc
    - run this command as root: gem update
    - run this command as root: gem install rails –no-ri –no-rdoc

    This worked on N800 with OS2008 5.2008.43-7. Props to Mateusz.

    Best regards and HTH(too)

  40. 40 Jon said at 3:14 am on February 15th, 2009:

    Yes, I haven’t been using my N800 for some time now for development. I have moved on from that device, but thanks for posting this. Maemo 2008 changed a lot, the instructions I posted were for an older version.

    Thanks again! – Jon


Leave a Reply