Home > blog > HOWTO: Ruby on Rails on your Nokia N800

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:

  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.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • BlinkList
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • Ma.gnolia
  • MisterWong
  • MySpace
  • Ping.fm
  • Print this article!
  • Reddit
  • Shadows
  • Slashdot
  • Spurl
  • StumbleUpon
  • Tumblr
  • TwitThis

Related posts:

  1. Ruby on Rails on the Go! About 4 days ago I managed installing Ruby on Rails...
  2. Ruby on Rails community support … sucks! I can’t believe how hard it is to get a...
  3. Mootools Videos still coming! Don’t worry I am still planning on it. As a...
  4. New website and Open Source Project! Hey I am working on a new website called Phoky....
  5. Developing … a Love and Hate relationship I hate Developing! Developing is not the most favorite thing...

, , , ,

  1. zach
    June 2nd, 2007 at 13:54 | #1

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

  2. June 3rd, 2007 at 00:34 | #2

    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!

  3. Mike
    June 3rd, 2007 at 12:20 | #3

    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.

  4. June 3rd, 2007 at 20:41 | #4

    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.

  5. June 5th, 2007 at 23:04 | #5

    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…

  6. June 5th, 2007 at 23:08 | #6

    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.

  7. June 5th, 2007 at 23:58 | #7

    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.

  8. June 6th, 2007 at 01:03 | #8

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

  9. Dave
    June 10th, 2007 at 03:48 | #9

    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

  10. June 11th, 2007 at 00:52 | #10

    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?

  11. Gene Venable
    June 11th, 2007 at 05:01 | #11

    When I ran gem update I got

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

  12. June 11th, 2007 at 08:14 | #12

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

  13. Dave
    June 11th, 2007 at 12:34 | #13

    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

  14. June 11th, 2007 at 13:14 | #14

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

  15. Dave
    June 11th, 2007 at 14:07 | #15

    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

  16. Dave
    June 11th, 2007 at 14:42 | #16

    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

  17. June 11th, 2007 at 16:05 | #17

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

  18. Dave
    June 12th, 2007 at 03:59 | #18

    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

  19. Gene Venable
    June 17th, 2007 at 14:08 | #19

    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.

  20. Gene Venable
    June 17th, 2007 at 14:11 | #20

    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

  21. June 19th, 2007 at 13:32 | #21

    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.

  22. Mike
    July 7th, 2007 at 17:14 | #22

    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.

  23. Mike
    July 7th, 2007 at 18:07 | #23

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

  24. Gene Venable
    July 7th, 2007 at 21:44 | #24

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

  25. jherber
    July 9th, 2007 at 04:42 | #25

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

  26. PePPeRV
    July 11th, 2007 at 02:04 | #26

    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.

  27. Gnarvaez
    August 12th, 2007 at 00:20 | #27

    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…

  28. Seggy
    August 15th, 2007 at 19:34 | #28

    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

  29. August 17th, 2007 at 08:19 | #29

    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!

  30. Marcus
    January 4th, 2008 at 06:25 | #30

    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

  31. Justin
    July 8th, 2008 at 19:13 | #31

    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?

  1. June 2nd, 2007 at 07:50 | #1
  2. June 6th, 2007 at 12:30 | #2
  3. July 2nd, 2007 at 15:06 | #3
  4. July 9th, 2007 at 17:24 | #4
  5. July 15th, 2007 at 10:26 | #5
  6. January 23rd, 2008 at 22:01 | #6
  7. November 16th, 2008 at 14:57 | #7