Jump to content
MDDHosting Forums

Debugging Ruby on Rails Startup issues


Recommended Posts

Just a quick tip for anyone who is getting started with Ruby on Rails.


If you find that your application doesn't start when you click cpanel's run button, take a look at your mongrel.log file. It can be found in ~/etc/rails_apps/YOUR_APP_NAME/log/mongrel.log


It has been absolutely invaluable in figuring out why my app wasn't starting.


You can also look at the production.log or development.log files in the same location if your application does start up, but you get weird errors.

Link to comment
Share on other sites

Another pitfall to watch out for...


When setting up your rails app and its redirect, cpanel will create/edit your .htaccess file for the domain you chose to redirect. I found its rewrite rule to not work at all, and generally be terrible.


Instead, make a new subdomain, then tell the ruby on rails module to create the rewrite for that location/subdomain. Once that is done, use cpanels file manager to open the .htaccess file for that subdomain (usually ~/public_html/NAME_OF_SUBDOMAIN/.htaccess).


Replace the contents of the file with these lines I paste below... Make sure you replace the values of SUB_DOMAIN, YOUR_DOMAIN, and PORT_FOR_YOUR_RAILS_APP.


RewriteEngine on



RewriteRule ^/?$ "http\:\/\/127\.0\.0\.1\:PORT_FOR_YOUR_RAILS_APP%{REQUEST_URI}" [P,QSA,L]


So for me, I ended up using the subdomain CR on my domain thecliplady.com, port 12002, and ended up with this:


RewriteEngine on

RewriteCond %{HTTP_HOST} ^cr.thecliplady.com$ [OR]

RewriteCond %{HTTP_HOST} ^www.cr.thecliplady.com$

RewriteRule ^(.*)?$ "http\:\/\/127\.0\.0\.1\:12002%{REQUEST_URI}" [P,QSA,L]


Anyways, I hope that saves someone a few hours. Hit me up if you need any help or clarifications on this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...