Topic: Help with Rails on DreamHost (+ Facebook, Subversion & Capistrano)

I've been going through the excellent Rails for Facebook tutorials by Stuart Eccles. However, I really want to get my head round FBML, and this means deploying to a host or getting a local environment configured so that Facebook can see my Mac through my gateway. I've been struggling with this, so if you can advise on any of these steps, it's much appreciated (DreamHost haven't been able to help me);

1. Completely local development, or iterate and then deploy on DreamHost?

I set my dLink router to forward the Apache ports to my Mac on the network. However, when I go to my networks IP (learnt from I only get the router admin page, and not the route of my Mac Apache /Sites/ folder. Do I need to resolve this before I can get Facebook to see my Mac? Should it just be going through to my /Sites/ folder as I think it should? Or will having the port 80 forwarded always cause the browser to show the router admin page, and can Facebook just magically go straight to my Mac regardless of the browser showing the router admin login page? I've checked this over and over, and the ports are definitely set. The only thing I can thing of is that the same port forwarding rule might be set on another IP that isn't currently in use on the network, and maybe the DLink is, for some bizarre reason, only going to forward the ports to the first IP that got the rule. I'll be trying out another router shortly, as I'm sure I've done everything I can.

Because of this issue, it looks like I'll need to develop on my localhost and deploy to DreamHost to see what everything looks like. However, OS X Terminal won't connect to my server at DreamHost. When I type in 'ssh', followed by the password, Terminal just sits and then times-out. If I type in the wrong password, it tells me so straight away. This is where it gets strange; I CAN connect through ssh using WinSCP for my Parallels installation of XP. Does anyone know why I can connect using WinSCP, but not through Terminal? I use shared-networking for Parallels.

2. Getting to grips with Rails/Capistrano/Subversion on DreamHost...

Just like Rails drills in DRY to beginners from the offset, I want to start with the right deployment and version control practices. So here's where I need some guidance;

If I'm developing on my Mac, do I need to install and configure Capistrano and Subversion on my Mac from the offset, and then install them and sync them with my DreamHost server (when I have SSH working)? Or should I just get stuck right into it and FTP over my developed app onto my subdomain at DreamHost and go to XP whenever I need to use SSH? Or do you guys think I should go through all of the Subversion & Capistrano manuals first?

Re: Help with Rails on DreamHost (+ Facebook, Subversion & Capistrano)

When you try to access your local domain from inside the domain, yes you will see the router login screen. This is because you're inside the domain. Anyone outside of the domain will not see this screen, but will see whatever port 80 is forwarded to. If port 80 has no forwarding, they will simply get a refused connection.

I do not know what could be causing your SSH issues, but that is weird.

You don't need to go through all the manuals, but for Subversion it would be good to cover committing, updating, importing, conflicts and what happens when files are merged.

Re: Help with Rails on DreamHost (+ Facebook, Subversion & Capistrano)

The ssh is not horribly uncommon with dreamhost.. I've had the same problem with a very very slow responding shell. Send them a quick email about it and ask if there is anything they can do like move you to a different server (it seems to be a a load problem, rather than a network thing on their side).

Re: Help with Rails on DreamHost (+ Facebook, Subversion & Capistrano)

Thanks guys.

I've sent quite a few emails to them - we got to the point where I found out that my Parallels XP could connect via SSH and OSX couldn't, and their last email just told me to 'check my settings'.  I'm going test out Cyberduck on OSX.

Re: Help with Rails on DreamHost (+ Facebook, Subversion & Capistrano)

Cyberduck can connect via SFTP (SSH), but Fugu also seems to hang on the password authentification process. Could it be my gateway causing problems? Or may differing versions of SSH? It's a shame Cyberduck doesn't have a console.

Re: Help with Rails on DreamHost (+ Facebook, Subversion & Capistrano)

I'm still no nearer to getting the SSH in OSX issue fixed, but I am making ground with getting a Rails Facebook app setup on DreamHost. However, because I want to use the rfacebook gem, I have to install gems locally.

I've been told that this tutorial - … positories - is the best way of installing gems locally. I've reached the second step, and I don't want to accidentally route Ruby to the wrong folder for gems, because I'm not 100% sure on how DreamHost stores my directories, i.e. I have noticed a '.gem' folder at my server root, but I've ignored this and done as the tutorial suggests in the first step and made a 'ruby/geminstall' at my server root. The second step;

mkdir /home/username/ruby/gems
export GEM_HOME=/home/username/ruby/gems

looks like it's asking me to change how Ruby finds its' gems. Unfortunately, I don't know what I need to put in place of /home/username, or if I should include them at all. If I log-in to my server,, I then have the /ruby/ folder sat at the root. Do I need to direct to 'export GEM_HOME=/root/neil/ruby/gems', or 'export GEM_HOME=/ruby/gems' or 'export GEM_HOME=/root/ruby/gems'?

I've done some reading/watching on using Capistrano & Subversion, but I still haven't tried them out on DreamHost - I'm sure I have lot's more fun on the way!

Re: Help with Rails on DreamHost (+ Facebook, Subversion & Capistrano)

I just managed to fix the SSH connection problem - I swapped over my DLink wired router to a wireless version (something I needed to do anyway!) and it all worked first time. Must've been something to do with the updated firmware, or that I'm now using AirPort. Now I'm on to installing gems locally, and getting my first dose of Subversion and Capistrano. Surely that's all the difficult stuff out the way??!!