Assuming ahead of time that you may eventually want multiple applications, you should make a work directory and then cd into it. You can name it whatever you would like, but this document assumes that it is called "rails".
% mkdir ~/rails
% cd ~/rails
Now you may create your application. As we are just making a simple Hello World application, we'll assume that the application is named "first".
% rails first
% cd first
Next, we're going to set up a subdomain for this application to run on. Log into your cPanel, click on 'subdomains', then type 'first' into the first text box and click 'Add'. You've now created a new subdomain, first.yourdomain.com, which will be the new home of your ruby on rails application. Now, we're going to make your application's "public" directory be the rootdir of that subdomain with the following commands:
% cd ~/public_html/
% rm -r first
% ln -s /home/YOUR_USERNAME/rails/first/public first
You should now be able to go to
http://first.yourdomain.com/, where you will see the Ruby on Rails welcome message. As the welcome page suggests, it is now time to set up your databases.
Bookmarks