killnine's picture

Hey guys,

Great job on the Rails appliance. Worked flawlessly out of the chute on my ancient Thinkpad T23 (just a cheap development platform to learn Rails).

However, I am confused about something: there are some great development environments for Rails applications. I have been using Aptana's offering. However, I dont understand the process of working on an application remotely.

As of now I have been developing on my Thinkpad T400 and using the local webbrick server ( I think), to test things about.

But if I was running a server on my T23 and wanted to develop on my T400, how would I do that?

I know you guys don't support Aptana software, but I was hoping you had some resources that you could point me to (other than Aptana's site). This is why I haven't purchased a dedicated Rails webhost: I don't understand the workflow between server and developer...

Sorry for the ranting post, thanks in advance ;)

Forum: 
szczym's picture

I don`t use rails everyday, instead i do stuff in Drupal, its php cms, so i will explain you on my scenario, but its generally similar situation, as i have understood your question.

i develop on ubuntu, where i have only text editors and gimp (+ photoshop but not very offten), no apache (webserwer component) or any database. Next to me in a corner is x31 with lamp appliance installed on it.

Because of that my desktop computer is light and i cane access websites on my local server via local network from any computer, also paths to files are relative to the _remote server_, and not to your file system. That scenario way better simulates real world situation, than apache running on your local system. (Of course you cane mount server`s file system into dir of your desktop machine.)

For extra security and comfort (egz. remote access) you might put the serwer ip into so called DMZ zone on your router.

cheers !
killnine's picture

Great, so its just a matter of getting my IDE to see the content on the other server. I think I can just map the drive or something and see if that works. Thanks. If anyone else has anything to chime in, just add your comment, too.
szczym's picture

What do you mean by IDE ?

Btw: Here is tutorial how to setup virtual machine so you might not need separate computer any more for server. http://www.turnkeylinux.org/docs/instalation-appliances-virtualbox
Liraz Siri's picture

Software appliances are a relatively new concept so your confusion regarding workflow is unfortunately rather common. I've tried to explain that before the forums. For example, see "How do I use TurnKey appliances?"

Hope that helps.

Our appliances can easily be installed to an old laptop or PC box but its really much more convenient as szczym already pointed out to install them inside a virtual machine such as VirtualBox.

Thanks to szczym, there is now a great HOWTO on how to do that for those who are unfamiliar with the software. It's really very simple once you figure out the basics.

killnine's picture

Well, I got the application to run fine, but it was more a matter of developing on the turnkey appliance. I mean, with content management systems like Joomla or Wordpress, merely having the appliance running is good enough because then you just surf to the appliance's IP address, login and you can start messing around by adding articles and such. With Rails, you really need to set up your IDE (integrated development environment) to see the remote filesystem, and treat it like you are editing the files locally. I think I have it figured out, though. Rather than having to start a webserver (see: webbrick) when developing locally, I can make the changes to the Ruby on Rails app, then just surf to the Appliance IP and see it working right away. Maybe if I thought about this a little more from the get-go it would have popped into my head that way.... thanks for all the support. These ISOs are really great and a fantastic way to get your feet wet in a multitude of different platforms.
Liraz Siri's picture

What you say about getting the IDE to "see" the remote filesystem is interesting. Could you share a bit more detail on that? Perhaps we could make changes to the appliance to make the kind of workflow you describe a bit easier to setup? We're always on the lookout for good ideas.
killnine's picture

Let's say I have a host that supports Ruby on Rails and I have access to an FTP through them. With Aptana Studios' RadRails package (aptana.com), you would want to map the FTP to a drive letter (Z, for instance).

Then you need to create a new Ruby on Rails project. So in RadRails you can just do the normal File>New Project... kinda thing. You want to put the new project on the FTP you just mapped: "Z:/SomeProject".

Because you have a host that is serving your application, you dont NEED the project to include its own server to run locally. Therefore, while many tutorials (http://www.aptana.com/docs/index.php/Starting_a_new_RadRails_project) say you should tell RadRails to install a WebBrick server or Mongrel server, you don't need to.

Since you have the source files mapped to this drive (Z), you can just edit them as any local file. HOWEVER, you dont have things set up for correct editing on the database. This means that if you run Ruby commands that require updating the database (basically any comment, but especially like RAKE and such), it's not going to work.

What you want to do is go into your ~/SomeProject/config/database.yml file and edit some of the configuration to reflect what your host has setup for your service:
  • database
  • host
  • username
  • password


**NOTE: lots of times your host remains "localhost" (to your webhost) it IS their local server. This is what gets complicated. If you were editing LOCAL FILES but wanted to reference a REMOTE database, you might change this to something like myusername.bluehost.com.

I know this is really garbled and probably doesn't give you guys much to work on, but understanding how to work on REMOTE applications is something I dont think ANY RoR community discusses. Its always "oh, you just create an application on your local filesystem and run Mongrel locally". But that doesn't help new people understand how they might migrate to a real production setting (e.g. NOT their laptop, ;P )

Add new comment