Loading...

Knowledge Base
Up to 75% off on hosting for WordPress websites and online stores

Setting Up Ruby on Rails

RoR (Ruby on Rails) is an open-source software designed to build various web applications. Ruby on Rails is divided into two parts: Ruby, which is a versatile general-purpose programming language, and Rails, which is a framework for building websites, apps, and systems. Rails is similar to a default user-friendly structure, making it easy to create anything.

Discover how to install Ruby on Rails and how to set it up.

Note: You need SSH Access before you can start setting up Ruby on Rails.



Ruby on Rails Installation

You can install the latest version of Ruby on Rails or whatever version you want (provided it's compatible with Ruby 1.9.3) as a local user: gem install rails --no-rdoc --no-ri. Create a new Rails application.

Rails 3.x

rails new ~/APPNAME -d mysql

You can specify the version using "-v" (for example, gem install rails -v 3.0.11 --no-rdoc --no-ri).

Note: To troubleshoot Ruby on Rails installation issues, visit the article: Troubleshooting: Ruby on Rail.

RoR Access

If you are using a subdomain, follow the How To Create A Subdomain steps. Make sure the Document Root box points to the folder you want the subdomain to be tied to (for example, if the name of your subdomain is 'APPNAME', point it to the public_html/APPNAME folder).

You will then need to create a Symlink to the public folder of your application. Enter the following command:

ln -s ~/APPNAME/public ~/public_html/APPNAME

.htaccess File Setup

You'll need this in the public folder for the app, which sets everything up, including where to look for user-installed gems. To add this, simply run the following commands:

  1. rm ~/APPNAME/public/.htaccess
  2. vim ~/APPNAME/public/.htaccess
  3. Press i to edit the file.
  4. Paste in the code from below.
  5. Enter :wq
  6. Press Enter to save the changes.
<IfModule mod_passenger.c>
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
#Set this to whatever environment you'll be running in
RailsEnv production
RackBaseURI /
SetEnv GEM_HOME /home1/examplec/ruby/gems
</IfModule>

.bashrc Configuration

You will need to add the following to your ~/.bashrc file.

~/.bashrc file

export HPATH=$HOME
export GEM_HOME=$HPATH/ruby/gems
export GEM_PATH=$GEM_HOME:/lib64/ruby/gems/1.9.3
export GEM_CACHE=$GEM_HOME/cache
export PATH=$PATH:$HPATH/ruby/gems/bin
export PATH=$PATH:$HPATH/ruby/gems

Summary

Ruby on Rails is a popular open-source software used for building web applications. It consists of two primary components: Ruby, which is a versatile programming language, and Rails, which is a framework for building websites and systems. This guide provides:

  • Detailed instructions for installing Ruby on Rails.
  • Accessing it.
  • Setting up the .htaccess file.
  • Configuring the .bashrc file.

Additionally, we have a helpful troubleshooting article that provides solutions for common installation issues.

If you need further assistance, feel free to contact us via Chat or Phone:

  • Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
  • Phone Support -
    • US: 888-401-4678
    • International: +1 801-765-9400

You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.

Did you find this article helpful?

 
* Your feedback is too short

Loading...