iA


Rails on Synology CubeStation CS-406

by Administrator. Average Reading Time: about 2 minutes.

Preparing for my workshop

Enable Telnet Access

see Oinkzwurgels page, download ‘syno-telnet-r3.zip’ and install it in the Synology Web Admin panel. The installation will stop at 99% – that’s fine

Now you can telnet to the CubeStation:

$ telnet 192.168.x.y
CubeStation login: admin
Password: 

BusyBox v1.1.0 (2006.08.06-13:52+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

CubeStation> ls

You can login as any user you created. For the following steps, login as root (same password as your admin account)

Bingo!

install the ipgk stuff

Again – from Oinkzwrurgels document:

CubeStation> cd /tmp
CubeStation> wget http://oinkzwurgl.org/dl.php?file=bootstrap-ppc.tar.gz
...
CubeStation> cd /
CubeStation> tar -xzvf /tmp/bootstrap-ppc.tar.gz 
...
CubeStation> ln -s /volume1/opt /opt
CubeStation> export PATH=/opt/bin:/opt/sbin:$PATH
CubeStation> /opt/bin/ipkg update
CubeStation> /opt/bin/ipkg upgrade

More software

CubeStation> /opt/bin/ipkg list | grep ruby                                                                                                                         
ruby - 1.8.5-1 - An interpreted scripting language for quick and easy object-oriented programming.
rubygems - 0.9.0-1 - Ruby packaging and installation framework.

CubeStation> ipkg install zlib
CubeStation> ipkg install ruby
CubeStation> ipkg install rubygems

I then installed the native toolchain as described on Oinkzwurgels pages

CubeStation> ipkg install make

Rails?

CubeStation> gem install rails --include-dependencies

Prepare a cup of coffee and wait. Get some more coffee. Do some chores. Go to sleep.

Update /root/.profile so that the PATH is set to include /opt/local/bin

Here’s my current:

#/etc/profile: system-wide .profile file for ash.
PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/syno/bin:/usr/syno/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"
umask 022
#This fixes the backspace when telnetting in.
#if [ "$TERM" != "linux" ]; then
#        stty erase
#fi
export PATH
HOME=/root
export HOME
TERM=${TERM:-cons25}
export TERM
PAGER=more
export PAGER
PS1="`hostname`> "
alias dir="ls -al"
export CFLAGS="/opt/include:/opt/crosstool/gcc-3.4.5-glibc-2.3.3/powerpc-603-linux-gnu/powerpc-603-linux-gnu/include"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L/opt/lib"
export PATH="$PATH:/opt/crosstool/gcc-3.4.5-glibc-2.3.3/powerpc-603-linux-gnu/bin/"
export PATH="$PATH:/opt/local/bin"

Let’s try it:

CubeStation> mkdir -p /volume1/test
CubeStation> cd /volume1/test
CubeStation> rails cube
...

If all goes well, the rails command should create the directory structure for a project.

CubeStation> cd cube
CubeStation> ruby script/server

starts Webrick and you can access your page through the webbrowser at http://192.168.x.y:3000

Tata.

Mongrel

So far I haven’t been able to install mongrel. The compilation fails because of

  • wrong paths in makefile (fixable)
  • missing syslimits.h header file (haven’t been able to track that down yet)

Next steps

Getting a real application with database access up and running

More software?

Oh yes – the NLSU2 page has more packages. So far I have installed:

  • mt-daap – the iTunes server
  • openSSH – no telnet for me, thanks

10 comments on ‘Rails on Synology CubeStation CS-406’

  1. Smick says:

    Question/suggestion: Why not use “localhost:3000″ or “127.0.0.1:3000″ in your instructions vs. “192.168.x.y”? It’d be one less thing for somebody to futz up! :)

  2. Administrator says:

    Because you are not accessing the Rails application from the same machine. Your browser is running on your computer, Rails is running on the Synology computer. Localhost:3000 would point to the same computer, the browser is on – and that’s not what you want in this case.

  3. Smick says:

    See? This is normally why I keep my mouth shut. ;)

  4. Administrator says:

    na – wrong approach. You learnt something by opening your mouth :-)

  5. tracks says:

    can you install tracks for free gtd? and if yes can you tell us, mortals, how to do it. thanks…

    http://www.rousette.org.uk/projects/articles/comments/linking-actions-and-yojimbo-items/

  6. Martin says:

    Hallo, ich bin auf der Suche nach einem NAS und möchte gleichzeitig Ruby On Rails kennen lernen – mir scheint ich habe die richtige Seite/Person gefunden… Meine Fragen: Ist dies (Ruby) auch mit einer 207 o.ä. möglich, oder nur auf die 406 beschränkt? Ist es grundsätzlich möglich, auf einem NAS (z.B. QNAP, Thecus) mit Linux ROR zu installieren? Oder ist Synology eine Ausnahme?

    Freundliche Grüsse
    Martin

  7. Administrator says:

    Grundsätzlich ist das sicher auf einer 207 möglich… Ich würde aber eine + empfehlen: schnellerer Prozessor & mehr Speicher.

    Wenn Du eine funktionierende Toolchain (Compiler, Linker, etc) hast, dann sollte das auf jedem Linux funktionieren…

  8. Richard says:

    Awesome, thanks for this. I tried starting

    gem install rails –include-dependencies

    but obviously, you weren’t kidding about the going to sleep part! I had to stop the process as it was making hickups in music played from our CS407.. I guess this part of the installation takes a lot of resources.

    Anyway, I’ll run the procedure overnight and try to go from there. Have you run into any problems building apps yet?

  9. Richard says:

    I ran into some problems on my CS407. The gem install process stopped with some errors. This was solved by performing a gem update, then upgrade, then reinstalling rails.

    Other than that, rails seems to be working fine — although I am getting some strange errors from ActiveScaffold (ActiveRecord::RecordNotFound in XController#show — error message Couldn’t find Entry with ID=update_table).

  10. Arjan van Bentem says:

    @Richard,

    I assume you first generated a full “normal” scaffold (rather than
    only a model)? That will have put a line like

    map.resources :x
    

    in your config/routes.rb. Remove that, and you’ll be fine.

    Arjan.

  11. Mark says:

    Have you ever had any luck getting this to run on a modern Synology system?

Leave a Reply