Archive for the 'rails' Category

Oct 27 2007

Starting Rails

Published by Stephen under rails, site5

After yesterday’s post I realized that I only proved that the subdomain worked. I didn’t actually get rails running. So today I’m continuing.

  1. Renamed public/index.html
  2. Edit config/routes.rb to define a default route, I uncommented the welcome controller entry
  3. Generated the welcome controller (ruby ./script/generate controller Welcome index)
  4. Added this to the index method
    1. render :text => ‘Hello World’
  5. Opened my browser and got this great error message:
    1. Rails application failed to start properly”

Now I thought, okay I didn’t create the DB yet. I also checked the logs and they were all 0.

I ended up using Site5’s SiteAdmin to create the DB. I discovered that my account doesn’t have create database rights through PhpMyAdmin or MySql command-line. Interesting, but no big deal (right now).

I tried to access the site again and got the same error. I thought about killing the cgi/fcgi processes, but I didn’t think I had started them yet. So I put the error into google and found this page: http://6brand.com/application-error-rails-app-failed-to-start-properly

I fired up my ssh connection and performed these commands:

  • cd ~/myrailsapp
  • chmod 755 public
  • chmod 755 public/dispatch.fcgi
  • chmod -R 775 log
  • chmod -R 775 tmp

I tried the site again and viola, rails is up with the render :text message.

Next, I try some real functionality. Or maybe I’ll try a capistrano deploy to get that all worked out first. And I guess subversion too.

No responses yet

Oct 26 2007

Simple Site5 Rails Symlink to Subdomain

Published by Stephen under rails, site5

I have Wordpress as my domain root and when I tried to nest a rails app as a subfolder things didn’t work out. Instead I created a subdomain (i.e. test.mydomain.com), then I symlinked the rails_apps/public to the subdomain.

At site5 this boils down to the following steps:

  1. Sign in to your SiteAdmin url
  2.  Click Manage My Domains, Subdomains
  3. Add the subdomain
  4. ssh to your domain
  5. cd ~
  6. Create your rails app > rails myapp
  7. Delete the subdomain directory created by SiteAdmin
    1. cd public_html
    2. rm -r subdomain
  8. Create the symlink from your rail app/public to the subdomain
    1. cd ~
    2. ln -s ~/myapp/public/ ~/public_html/subdomain
  9. Open your browser to http://subdomain.mydomain.com
    1. You should see the default index.html file for Rails

References:

http://www.hostingrails.com/forums/deployment_troubleshooting_thread/145

No responses yet