HostMonster Web Hosting Help

Ruby on Rails Setup



Create your Rails Application

  1. Install whatever version of rails you want (provided it's compatible with ruby 1.9.3) as a local user: gem install rails --no-rdoc --no-ri

  2. Create a new Rails application.

    Rails 3.x

    rails new ~/APPNAME -d mysql
Note: You can specify the version using "-v" (e.g. gem install rails -v 3.0.11 --no-rdoc --no-ri)
You may also use Rails v. 2.x for your app using the following syntax

Access Your RoR Application

If you are using a subdomain you can use the following steps to create the subdomain.

  1. Log into your hostmonster control panel
  2. Select 'Subdomains' from the 'Domains' section
  3. In the small form that loads, type in the name of your subdomain (example 'APPNAME')
  4. From the drop down box select which domain you want to create that subdomain on.
  5. Make sure the "Document Root" box points to the folder you want the subdomain to be tied to. In this case, we want it to point to the public_html/APPNAME folder that we just created.
You will then need to create a Symlink to the public folder of your application. To do this simply enter the following command:

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

Setup the .htaccess file

You'll need this in 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>

Configure your .bashrc

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
Knowledgebase Article 177,220 views bookmark tags: rails ruby (updated 104 days ago)


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

What Ruby on Rails version and Gems are installed? (updated 164 days ago)
Knowledgebase Article 62,927 views tags: gem gems rails ruby

My Ruby on Rails installation keeps displaying a '404 Not Found' error. (updated 704 days ago)
Knowledgebase Article 77,015 views tags: file missing public rails ruby

When I attempt to execute my Ruby on Rails application I receive "500- Premature end of script." (updated 742 days ago)
Knowledgebase Article 52,348 views tags: premature rails ruby script

Related Help Content

How to install Redmine a Ruby on Rails application (updated 152 days ago)
Knowledgebase Article 18,086 views tags: redmine ruby

When I execute the 'Generate' command in my first Rails project, I get numerous errors and the controller is not built. (updated 164 days ago)
Knowledgebase Article 50,933 views tags: generate ruby

How do I install my own Ruby Gems? (updated 164 days ago)
Knowledgebase Article 72,432 views tags: gem install ruby

Rails Troubleshooting! (updated 162 days ago)
Knowledgebase Article 22,642 views tags: rails

What is the path to Ruby? (updated 1263 days ago)
Knowledgebase Article 59,265 views tags: path ruby

How do I setup CuteFTP 8.2 for FTP? (updated 670 days ago)
Knowledgebase Article 66,755 views tags: connect cute ftp set settings setup upload

This article will explain how to use RoR through passenger on a VPS or Dedicated hosting account (updated 152 days ago)
Knowledgebase Article 21,717 views tags: dedicated passenger redmine ruby vps

How do I setup Dreamweaver 8 for FTP? (updated 670 days ago)
Knowledgebase Article 76,728 views tags: client configure dream file information party program protocol set setup steps transfer