Ruby on Rails website tutorial
Introduction[edit | edit source]
A website was created with a laptop running Windows XP and hosted with Site5. Notes are below outlining steps, and there are links to sites that explain steps in additional detail.
Instant Rails and RadRails[edit | edit source]
Instant Rails version 1.4 provides Rad Rails support as of the time of this writing (December 23, 2006). There are sites available to download Instant Rails and RadRails. A link is provided to instructions about how to install and run Instant Rails and RadRails together. Note that the Instant Rails ruby executable was added as an Installed Interpreter.
[edit | edit source]
Note that a first step is request Bash shell access. There are helpful instructions on Site5 community forum about using a keypair to bypass typing a password, creating a repository, and connecting to the repository. Tortoiseplink was used in place of plink, and a full directory listing was used when referencing plink in the subversion config file. There is a note online explaining this detail in an posted e-mail about an svn+ssh solution. The program tortoiseplink.exe was used after downloading TortoiseSVN
There are help contents in RadRails that explain how to create a repository location within RadRails. The section is titled "Creating a new Repository Location." There is also a section about how to configure a svn+ssh connection. The section title is "How do I configure an svn+ssh:// connection?"
If everything proceeds well, one is able to upload a project to repository created on a site5 account. Uploading a project to a subdirectory of repos by using a "team" option to commit to a repository with RadRails.
Setting up Application and Deploying[edit | edit source]
There are sites available that include an explanation about setting up an application to be deployed; examples are thebitguru.com and fluctisonous.com. After configuring files, it should be possible to upload an application to a repository and deploy it with commands "rake remote:exec ACTION=setup" and "rake deploy", respectively. These can be entered from within the ruby console created with Instant Rails.
There are instructions about modifying database.yml, and mySQL databases were created and permissions granted with SiteAdmin, an online tool provided by Site5. A database was named onethrea_demo, and the following line was used to populate the database from within the db directory of the app:
mysql -u onethrea -p onethrea_demo /db/schema.mysql.sql
Note that a sub-directory can be created within the public_html folder, and a symbolic link is used to connect the application with the sub-directory. See post #7 in a link provided to see information about creating a symbolic link.
Dispatch.cgi, Dispatch.fcgi, and Dispatch.rb[edit | edit source]
There are discussions on a site5 forums may be relevant regarding editing dispatch files.
Use a unix editor over ssh to edit dispatch.cgi and dispatch.fcgi files, since there are different line endings involved when using windows editors. This advice and additional comments can be found in post #7 on the page of a site5 forum.
Remote Access to Site5[edit | edit source]
There is a post on Site5 regarding remote access to a MySQL database.
Solving Issues[edit | edit source]
The error log found under SiteAdmin is a useful tool when attempting to determine sources of error. This can be found under error logs of "Stats and Web Logs". It can also be helpful to use the File Manager included with site5, FileZilla, or an ssh tool to determine whether files have been successfully been loaded and locations of files.