Reply to topic
Getting started with the HMS Ruby on Rails Beta.
jstedman


Joined: 29 Apr 2006
Posts: 27
Location: Newark, DE
Reply with quote
Hey Folks,

I just wanted to post a quick topic here for anyone having trouble getting started with our Ruby on Rails Beta. If you haven't signed up yet and you're interested, check out our page at http://www.hostmysite.com/rails for more info.

Besides the tutorial info, there are a few things to note about the way that we specifically run Rails on our server. The biggest change if you are following one of the tutorials - particularly from either the O'Reilly Rough Cuts edition of their upcoming "Ruby on Rails: Up and Running" publication or the OnLamp tutorial here - is that they assume you are developing on a local machine with no Web server, and will have you start Ruby's built in WEBrick server from your application's path. This is great on your local machine for running a Dev version, but on our server your setup will be a bit different.

Log in to your Ruby account via SSH

From your account's root, you'll see the htdocs folders among others. HMS veterans will know that this is where you will put all of your web documents. Resist the urge to create your application in the htdocs folder! Doing so will give you a long URL to your actual web files, but could also put your configuration information live on the web. This is a Bad Thing (TM).

Instead, run the application generator in your root, or create an applications diretory if you prefer.

Code:
rails testApp


Now how are you going to see your docs online if they aren't in the htdocs folder? Options +FollowSymLinks, my friends. It's enabled on the Rails server. Create a symbolic link in your htdocs folder to the public directory in your testApp. use PWD if you don't know what your path is to the root directory of your account.

Code:
ln -s /vservers/DIRECTORY/testApp/public/ /vservers/DIRECTORY/htdocs/testApp


Now view your site at domain.com/testApp and you should see the Ruby on Rails welcome page. You should now be ready to follow the instructions from whichever tutorial you're reading.

If you're only going to run one application on the account, or at least that's all for now, you can safely either delete or rename the htdocs directory and then make your symlink called htdocs in your root. Use mv to rename the directory, and take the last /testApp off the end of the ln command from before.

Good luck with your coding, and thanks for participating in our Ruby on Rails Beta!

EDIT: Corrected the code for the symlink


Last edited by jstedman on Tue May 30, 2006 8:43 pm; edited 1 time in total
Re: Getting started with the HMS Ruby on Rails Beta.
JdeJong


Joined: 03 May 2006
Posts: 9
Reply with quote
jstedman wrote:
Code:
ln -s /vservers/DIRECTORY/testApp/public/ /vservers/DIRECTORY/htdocs/testApp/


This is incorrect the last / behind testApp should not be there !!

It should be:

Code:
ln -s /vservers/DIRECTORY/testApp/public/ /vservers/DIRECTORY/htdocs/testApp

Also shorter version is:

Code:
ln -s ~/testApp/public/ ~/htdocs/testApp

Make sure you are in your root though !!

For my log on my progress se http://forums.hostmysite.com/viewtopic.php?t=1593
Nsahlas


Joined: 08 Apr 2004
Posts: 43
Location: Chicago
Reply with quote
When I try to run the following command:

ln -s /vservers/DIRECTORY/testApp/public/ /vservers/DIRECTORY/htdocs/testApp

I get the following message:

-bash-3.00$ ln -s /vservers/DIRECTORY/testApp/public /vservers/DIRECTORY/htdocs/testApp
ln: creating symbolic link `/vservers/DIRECTORY/htdocs/testApp' to `/vservers/DIRECTORY/testApp/public': No such file or directory
-bash-3.00$
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
Nsahlas - Make sure you're replacing the "DIRECTORY" with your actual home directory name(usually your username)

What the command does is make a shortcut from your "public" directory for your application to your web root, so your application can be accessed through the web

Let us know if you have any more problems Smile
Nsahlas


Joined: 08 Apr 2004
Posts: 43
Location: Chicago
Reply with quote
Ok so I am idiot as I did put "DIRECTORY" I ran the link command correctly this time and it seems to have worked however I am not getting the page to display:

http://86184.hostmyapplications.com/testApp

Thanks for the help.
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
Nsahlas - You might want to try following the blog tutorial. Basically the issue is you've got a Rails app created, but you don't have the database config setup or any model/controller/views created

If you go through the blog tutorial it covers how to set all of that up and get an app working
Nsahlas


Joined: 08 Apr 2004
Posts: 43
Location: Chicago
Reply with quote
It is up an working. Thanks
Getting started with the HMS Ruby on Rails Beta.
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic