Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Ruby on Rails

  1. #1
    Forum Administrator Power Poster Lyle@Spry's Avatar
    Join Date
    May 2005
    Posts
    455

    Default Ruby on Rails

    Now that Ruby on Rails has released version 1.0, I think it's time to explain how to install this awesome web development framework.

    This page gives a quick general run-down of the steps needed to integrate Rails with Cpanel.

    First, you'll need to download/install Ruby. SSH to your server as the root user. The steps below will download the ruby tarball directly to your server, if you want to download a copy to your workstation: Download Ruby
    Code:
    # cd /usr/local/src
    # wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.3.tar.gz
    # tar xzvf ruby-1.8.3.tar.gz
    # cd ruby-1.8.3
    # ./configure && make && make install
    Next you'll want to install RubyGems.
    Code:
    # cd /usr/local/src
    # wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
    # tar xzvf rubygems-0.8.11.tgz
    # cd rubygems-0.8.11
    # ruby setup.rb
    Now that Ruby Gems is installed, you can use it to install the Rails framework.
    Code:
    # gem install rails --include-dependencies
    Congratulations! Rails is now installed! Wasn't that easy?

    To actually make a rails application public on your website: (You can log in via SSH as the site owner now, no need for root privileges anymore.)
    Code:
    $ cd ~
    $ rails application_name
    $ cd public_html
    $ ln -s ~/application_name/public rails
    Now if you view http://www.yourdomain.com/rails/ in a browser, you should see the "Welcome aboard You're riding the Rails!" congratulations page.

    Note, for better performance, you'll want to install FastCGI, mod_fastcgi, and ruby's fcgi module and configure Apache and your rails application to use dispatch.fcgi vs. the default dispatch.cgi in ~/application_name/public/.htaccess See the link above for more information on doing this.

    Suggested reading:
    Last edited by Lyle@Spry; 12-14-2005 at 02:36 PM.

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    5

    Default Thanks!

    This post has saved me what I expect would have been a great deal of pain. Thanks very much, Lyle!

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    5

    Default Ruby 1.8.4 and Rails 1.1?

    But of course, today I learn that Rails 1.1 is out, with Ruby 1.8.4 strongly recommended because earlier versions of Ruby may not be supported for much longer. Now that I've already got Ruby, Gem, and Rails installed as described above by Lyle, what is the best way to do the upgrade? I do not yet have any deployed applications or code that is in any way dependent on these modules.

  4. #4
    Forum Administrator Power Poster Lyle@Spry's Avatar
    Join Date
    May 2005
    Posts
    455

    Default Upgrading from 1.0

    Hooray! A new version with tons of bugfixes and new features!

    Here's the official release notice and a quote with the upgrade instructions:
    Quote Originally Posted by weblog.rubyonrails.org
    Upgrading from 1.0

    So with such a massive update, upgrading is going to be hell, right? Wrong! Weíve gone to painstaking lengths to ensure that upgrading from 1.0 will be as easy as pie. Here goes the steps:

    * Update to Rails 1.1:
    gem install rails --include-dependencies
    * Update JavaScripts for RJS:
    rake rails:update

    Thatís pretty much it! If youíre seeing any nastiness after upgrading, itís most likely due to a plugin thatís incompatible with 1.1. See if the author hasnít updated it and otherwise force him to do so.

    If youíre on Ruby 1.8.2 with Windows, though, youíll want to upgrade to the 1.8.4 (or the script/console will fail). And even if youíre on another platform, itís a good idea to upgrade to Ruby 1.8.4. We still support 1.8.2, but might not in the next major release. So may as well get the upgrading with over with now.
    If you followed my instructions in the original post of this thread, then upgrading Ruby itself should be as simple as downloading the latest tarball and running configure and make and make install with the same options you used to install version 1.8.3. This will overwrite your older install in the same location.

    Please note I have not yet upgraded my install, but will be soon. If you notice any strangeness when doing this yourself, please give a shout out to the rest of us. I'll update this thread once I've done it myself.

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    2

    Default Lighttpd + Mongrel

    Hey Lyle, is it possible to install Lighty + Mongrel in my VPS to serve my Rails sites rather than Apache? I am using the RedHat OS

  6. #6
    Forum Administrator Power Poster Lyle@Spry's Avatar
    Join Date
    May 2005
    Posts
    455

    Default

    Quote Originally Posted by jedhurt
    Hey Lyle, is it possible to install Lighty + Mongrel in my VPS to serve my Rails sites rather than Apache? I am using the RedHat OS
    Of course! All our VPS products give you root access, so you can install anything you want (well, almost, check our AUP first)

    I've never used Mongrel, but from that page it looks like you don't even need lighttpd. Keep in mind only one daemon can bind to port 80 of your server (technically you could configure a different daemon to bind to port 80 of separate IPs), so you have to choose between Apache, Lighty, Mongrel...

    I personally use FastCGI with Apache so I can continue to host static files and PHP apps with Apache and use cPanel/WHM to manage the server.

  7. #7
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    2

    Default

    Do you know of any good tuts to install FCGI in redhat? I tried to follow one the other night, but it turned to be quite confusing...

  8. #8
    Forum Administrator Power Poster Lyle@Spry's Avatar
    Join Date
    May 2005
    Posts
    455

    Default

    Quote Originally Posted by Lyle@Spry
    Note, for better performance, you'll want to install FastCGI, mod_fastcgi, and ruby's fcgi module and configure Apache and your rails application to use dispatch.fcgi vs. the default dispatch.cgi in ~/application_name/public/.htaccess See the link above for more information on doing this.
    Just skip ahead to the section entitled Install FastCGI.

  9. #9
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    5

    Default A rails app in the root path

    I am trying to run a rails application in the root path of a subdomain (e.g. test.mydomain.com).

    I presume that doing this requires some hackery of the RewriteBase parameter and perhaps other things in MYRAILSAPP/public/.htaccess but I'm having trouble getting it working. I'm getting a bunch of these: "[warn] FastCGI: (dynamic) server "/home/MYRAILSAPP/public_html/beta/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds"

    I checked dispatch.rb and dispatch.fcgi and sure enough they were still pointing to the ruby installation on my Windows workstation, so I corrected them to /usr/local/bin/ruby (which reports Ruby 1.8.4; rails reports version 1.1.2), but this didn't resolve the problem.

    Can anyone offer any advice?

    Thanks,

    Songdog
    Last edited by Songdog; 04-24-2006 at 09:19 PM.

  10. #10
    Member Newbie tamlyn's Avatar
    Join Date
    Aug 2005
    Location
    Manchester, UK
    Posts
    67

    Default

    Well I've spent quite while on this and tried so many things I can't even remember but I *think* I might finally have got fcgi working! How can I make sure it really is using fcgi rather than normal cgi? It certainly seems much faster than it used to be.
    "They think they've tricked you. And then they have."

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
  •