Oct 27 2007
Starting Rails
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.
- Renamed public/index.html
- Edit config/routes.rb to define a default route, I uncommented the welcome controller entry
- Generated the welcome controller (ruby ./script/generate controller Welcome index)
- Added this to the index method
- render :text => ‘Hello World’
- Opened my browser and got this great error message:
- 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.