The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ruby on Rails Question

Discussion in 'General Discussion' started by griz, Aug 9, 2011.

  1. griz

    griz Well-Known Member

    Joined:
    Dec 29, 2001
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    I recently installed Ruby using /scripts/installruby - and now have version 1.8.7 installed.

    My client, however, has need for the latest version - 1.9.2

    Is there any way for me to upgrade to the latest version?

    Thanks in advance,

    Griz
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello Griz,

    If you upgrade Ruby to a higher version, then it will not work with cPanel > Ruby on Rails area to generate applications any longer or be supported by cPanel for any issues that arise. If you are fine having to always manually create an application for this one customer every time it is required, then you could move the existing ruby binary and libraries, download the file at http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz to the server, unpack it, and install it there with these commands:

    Code:
    mv /usr/bin/ruby /usr/bin/ruby.bak110809
    mv /usr/lib/ruby /usr/lib/ruby.bak110809
    cd /root
    wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
    tar xzf ruby*
    cd ruby
    ./configure
    make && make install
    ln -s /usr/local/bin/ruby /usr/bin/ruby
    ln -s /usr/local/lib/ruby /usr/lib/ruby
    You should then see the new version:

    Code:
    ruby -v
    ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
    At that point, your cPanel Ruby and Rails environment won't be compatible with what we support and any issues that arise will be unable to be investigated by technical support. As such, I would highly suggest staying with the supported 1.8.7 version unless you are willing to forgo all support mechanisms and all cPanel-based automation for generating applications.

    Important Note: For anyone who is following the above instructions, please use at your own risk. This is not a recommendation to follow that upgrade path. I am actually recommending against doing it.

    If you end up causing issues with everything upon doing the above and wish to revert to the prior setup, simply do the following:

    Code:
    rm /usr/bin/ruby
    rm /usr/lib/ruby
    mv /usr/local/bin/ruby /usr/local/bin/ruby.bak110809
    mv /usr/local/lib/ruby /usr/local/lib/ruby.bak110809
    mv /usr/bin/ruby.bak110809 /usr/bin/ruby
    mv /usr/lib/ruby.bak110809 /usr/lib/ruby
    ln -s /usr/bin/ruby /usr/local/bin/ruby
    ln -s /usr/lib/ruby /usr/local/lib/ruby
    Check the ruby version has reverted:

    Code:
    ruby -v
    You should then see:

    Code:
    ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
    Good luck!
     
Loading...

Share This Page