Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    1

    Default Get Ruby on Rails working... the right way.

    Warning: Westhost doesn't support us playing around deep in our server like this, they may give advice on chat, but this stuff you do is at your own risk.

    Intro: Westhost IS NOT Rails Ready

    Part of the reason I came to Westhost a few years ago is because it served my needs AND could host Ruby on Rails apps. While I hadn't built in rails yet, I planned on it. 4 years later, I got around to building a rails app and am ready to deploy... but guess what? Westhost's built in RoR and Ruby builds are terribly out of date and not ready for prime time.

    I am not yet ready to move my sites off of Westhost though. I like them too much, minus this hiccup. So I figured it out. And now you can follow along too.

    Warning: I fully expect you to be familiar with command line operations at this stage in the game. If you've built a ready to deploy rails app, you should be comfortable in an SSH command line interface. If not, run away now.

    Step 1: "Install and Manage" Your Site Applications First

    First we need to get rid of (if we have it installed) the provided installs for Ruby and Ruby on Rails. Also, at this time, I highly recommend installing MySQL, so we can install the gem when the time is right. Finally, because we are going to be clean installing the Ruby from source, you need to install the GNU tools.

    All in all, here is your to-do list:

    • ADD: GNU Compiler Tools
    • ADD: MySQL
    • REMOVE: Ruby
    • REMOVE: Ruby on Rails


    Step 2: Login to Terminal by SSH

    Please tell me you know how to do this? If not, time to learn. Every computer and terminal application is different. For me, I used a Mac program called iTerm and typed:

    Code:
    ssh [username]@[domain.com]
    Obviously replace the bracketed examples with your info.

    You will be prompted to enter your password. Do so and press enter.

    Step 3: Create a SRC directory

    We're going to download the source for ruby, etc, so lets make a place to put it. (Each line is a separate command. Copy-paste and execute one at a time.)

    Code:
    cd /usr/local
    mkdir src
    cd src
    Step 4: Download & Install Ruby

    Okay, now lets download and extract Ruby source code.

    Check at the ruby site for the latest stable version. Leave the edge version for your local development machine. At this time its 1.9.2. Replace the file name with the recent version on the ruby site.

    http://www.ruby-lang.org/en/downloads/

    Note: as of today, 8/20, version 1.9.2-patch0 didn't compile for me on the Westhost. Thats okay, Rails requires 1.9.1 only.

    Code:
    wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.1-p429.tar.gz
    Unzip it and move into the folder:
    Code:
    tar -xzvf ruby-1.9.1-p429.tar.gz
    cd ruby-1.9.1-p429
    Now lets make our install and execute the installation.
    Code:
    ./configure
    make
    make install
    And to test it, lets try this:
    Code:
    which ruby
    Which should result in this:
    Code:
    /usr/local/bin/ruby
    Get out of that folder:
    Code:
     cd ../
    Success (so far)!

    Step 5: Download & Ruby Gems

    This step is a lot like the last.
    Code:
    wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
    tar -xzvf rubygems-1.3.7.tgz
    cd rubygems-1.3.7
    ruby setup.rb
    Step 6: Install Gems

    What gems you want is up to you. Obviously rails, thats why we're here. Another you should have, MySQL for your databases.

    Code:
    gem install rdoc
    gem install rdoc-data
    gem install rails
    gem install mysql
    gem install capistrano
    gem install passenger
    Step 7: Configure Passenger

    So why did we install that last gem? Passenger is the super-easy-to-use deployment tool that will get you running really fast. My goal in this how-to was to document getting a stable, modern version of rails running on your Westhost VPS. To deploy you should use Passenger, so you should definitely look it up.

    Have Fun!
    Last edited by brickbros; 08-20-2010 at 11:42 PM.

  2. #2
    Junior Member
    Join Date
    Feb 2007
    Posts
    1

    Default Thank you

    Thanks! Very clear and helpful write-up.

  3. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    1

    Default

    Sorry to dig up this old thread, but I'm now running through this same process of setting up Rails and have run into a snag with Passenger. When trying to install with passenger-install-apache2-module I get the following error:

    Curl development headers with SSL support... not found

    Some required software is not installed.
    But don't worry, this installer will tell you how to install them.

    It then gives instructions about installing curl, but when I try and build curl it complains about not being able to build with ssl even when specifying --with-ssl to configure.

    So the question that I have for you is: What version of Passenger are you using?

    Basically I want to find a version of Passenger that will install on my VPS.

    Alternatively, if anyone knows how to get the curl development headers with SSL support that would be preferable.

    Thanks,
    Chris

  4. #4

    Default

    works for installing 1.9.1, but it appears that rails wont work with 1.9.1 - and i have been unsuccessful getting 1.9.2 to build.

    it appears we need "RVM" but in order to have that, we need "GIT".... and that wont build either!

    maybe the glibc is too old - i show:
    ldd (GNU libc) 2.3.4

Posting Permissions

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