SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot tconley79's Avatar
    Join Date
    Feb 2004
    Location
    Miami
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    THOROUGHLY confused about deployment

    I'm usually quite speedy about catching on to new concepts, but this whole rails deployment thing has really got me down.

    I started the Sitepoint book last week (as well as Black's Ruby for Rails) and now I have few test-tube apps I want to deploy to my remote server (hosted by Hostgator). But after scouring the web all day for "how-to's" I seem to be more confused than when I started.

    All of these app names are being thrown around like Mongrel, Capistrano, Lighttpd, Surversion, TortoiseSVN, and such. Do I need all of them? Do I need only some? Does one app depend on the existence of another?

    I know deploying a rails app wasn't going to be as cut and dry as say, transferring my php code, but I'm having such a hard time finding a step by step guide.

    Any help/links/articles would help alot.

    Thanks.

  2. #2
    Once I was a Factory Worker goofy's Avatar
    Join Date
    Dec 2004
    Location
    Sydney Australia
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For anyone who hasn't done of lot of development stuff (including myself), it can be very confusing. I'll try to clarify a few things and what they are for.

    Mongrel is the part of your web server that will interpret your rails apps, kind of like the php interpreter does with your php code. You don't have to have it but if you don't you need FastCGI setup on you web server to do that instead. Many rails developers seem to prefer Mongrel so you either need to setup up on your web host or it it's setup already.

    Capistrano is to help you deploy your applications, basically a script that has all the details of you web server etc so you can just call this script to deploy your app once your config files have all the necessary information.

    Lighttpd is an alternative to Apache as your web server. Again you can set it up but you web host probably has everything you need to run a rails app if they have rails as part of their specs.

    Subversion is a version control tool for managing your source code. It is widely used by many developers around the world particulary where groups of developers are working a the same project at the same time. Subversion is command line driven so that is where TortoiseSVN comes in. TortoiseSVN allows you to have a graphical frontend to subversion with menus etc when you right click on a file. Instead of writing the svn commit etc at the command line you can right click on the file you want to check in and select commit.
    Goofy
    Life is what you make it!
    Follow your dreams!

  3. #3
    SitePoint Enthusiast thebasti's Avatar
    Join Date
    Aug 2004
    Location
    Novi Sad, Serbia
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Actually Mongrel is not part of the web server. Mongrel is a web server written in Ruby.

    Mongrel is a fast HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI.
    As for deploying Rails app it largely depends on your server setup. I've deployed Rails app on two different hosting companies and the process is different. It mainly depends on what web server you can use for running Rails app.

    So it would be best to talk to your hosting company and ask them how to setup Rails app.
    "Strategy without tactics is the slowest route to victory.
    Tactics without strategy is the noise before defeat."
    - Sun Tzu
    Icebergist - a web dev blog | Orange Iceberg Web App Development

  4. #4
    SitePoint Zealot tconley79's Avatar
    Join Date
    Feb 2004
    Location
    Miami
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks!

    Thank you both for your help...and for explaining the programs to me

    Well I contacted Hostagator, and they gave me shell access to my account. I made a folder in my root directory and copied my local app folders there. What I did then was log into my account via telnet. Someone on the hostagtor forums suggested I run
    Code:
    rails .
    on the folder (making sure I didn't overwrite in key files like application_controller and routes)...I guess to make sure all the required files were there. I then did my migrations to the production database, changed my environment to production in environment.rb, and finally made a symlink from a folder in my wwwroot to the app folder...whew.

    Well the app seems to be running (it's the shovell app from the Sitepoint book) but it's slower than on my PC. I was told this was because Hostgator doesn't yet support FastCGI (whatever that means LOL).

    But, hey, I least I got it up. I'm sure there are easier and more efficient ways to do it, so I'll look into Capistrano and subversion soon.

  5. #5
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's probably going to be worth it to you to find a new host. Blue host i'm using for rails stuff.... there is a link in the stickies here for rails hosting.

  6. #6
    SitePoint Guru Skyblaze's Avatar
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    734
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in the sitepoint's ails book everything is so clear about the deployment of the application. I can't see any problem

  7. #7
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The main thing is to feel comfortable developing on your local machine using webrick....

    once you get to that stage, look at getting a proper webserver. Generally speaking Lighttpd is the webserver of choice, and it is used in wither FCGI (FastCGI) mode or using a proxy via Mongrel (which is a mini web server like webrick, but you need to use lighttpd infront of it on anything that has any volume of traffic).

    Subversion is a good tool to learn to use. You don't need to use it to start with. It helps you manage your code. As a solo developer you can do without, but when you have the time and mental energy to learn something, learn how to use this along with TortoiseSVN. Subversion helps manage your code as it allows you to go back in time and grab eariler versions of a file, and compare the changes of that with say your current version. It's main power comes when it comes to team development because each member of the team has a user account and when things break you can compare the changes to given files over a period of time to see where something has broken and see who did it. It also saves you using nasty dated tools like FTP, so that you can automate deployment without the faff of using FTP. Also, if you work in many places, Subversion can help you by sync up your files between all your PCs so you have the latest version without being prone to the human error of replacing a new version code with something older etc.

    Capistrano is an automated deployment tool. You can quickly write scripts that allow you to deploy your site quickly (over a a number of machines if you have a really big app). You won't really need to use it unless you have a big application that is tricky to deploy on your host. Cap works by using a standised "template" for deployment (it has set conventions for folder structure etc). Capistrano works with Subversion and your web server / database as well as your Rails application to automate deployment. You probably won't need to use this for a while, but learn how to use it at some point.

    If you say you don't have FastCGI, look at using Mongrel and lighttpd proxies. What you normally do is run 5 instances of your site under separate mongrel webservers (so up to 5 concurrent users can access it) and then use Lighttpd to link them mongrel web servers by making it act as a proxy to them. You can increase or decrease the number of mongrel instances according to your traffic and server resources you have at your disposal.

    Mongrel seems to be the perffered way to wire up a Rails application to a webserver (namely Lighttpd, but can be Apache). FCGI is very platform (and to some degree web server dependent, as early versions of Apache had poor FCGI support. FCGI requires you to be working on a non windows system). SCGI has patchy Windows support and few webservers support SCGI. SCGI is a newish protocol that replaces CGI and FCGI. However, Mongrel was made to replace SCGI. Mongrel allows you to bridge your rails app to any web sever with proxt support (most do), which is why it is so popular. Also, the use of proxying means you can scale your site over a number of machines more efficiently when you make a big app.

    So all in all, I suggest looking at Mongrel for your web server. Talk with your hosting company to see things are setup, because like sone one said, hosting setups can vary a lot. Mongrel is the most platform independent deployment choice though, so should work in most cases. Subversion is well worth learning. TortoiseSVN is just a Windows GUI to subversion that works in Explorer, which does simply the learning curve under Windows. However if you become a seasoned developer, you'll probably start using the command line more and move over to something like Ubuntu, because Windows is such a hostile/unfriendly platform for Ruby development because everything has to be installed using 3rd party installers, where as a good Linux distro will have a standardised system for quickly installing Ruby, Rails, SQL DB, Texteditor of choice (GEdit, SciTE, and Kate by default have good Ruby syntax support when compared to Notepad).

    If you are scared about deployng, why not have a play at installing a Linux distro on you computer (you can use VMware, or something similar if you don't want to repartition, or find an old PC you can wipe totally), and have a play with trying to get a webserver setup from scratch. It will help a lot with understanding the tools involved and you don't have to be scared of messing up. If you use Vmware you have the added bonus of the snapshot tool to help you go back on you **** ups which is handy.
    http://virtualfunction.net - Rails Web Development
    http://squaremove.co.uk - Rails powered Property Listings


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •